[TIMOB-2585] Include paths for iphone and android are not based on the same starting point
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:59:31.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.7.0, Sprint 2011-10 |
Components | Android |
Labels | android, defect, enterprise, klist, release-1.7.0, reported-1.5.0, rplist |
Reporter | PaulT |
Assignee | Don Thorp |
Created | 2011-04-15T03:23:30.000+0000 |
Updated | 2011-04-17T01:59:31.000+0000 |
Description
This issue is making me nuts! :-)
I have broken my app into small, manageable pieces and link things together using Titanium.include and the 'url' property when creating a new window.
Both of these require a 'path' to a .js file. The trouble is, one platform seems to want it relative to the root and the other relative to where the file is being included from. The url property used to be the same (iphone vs android) until 1.5, but after I upgraded today I found that it had changed on android requiring me to fiddle the paths to get the app working again.
Can we please have it one way or the other on all platforms? I am trying to build a core of code that will work across all platforms and having to deal with varying path models is just making my code that much more complex.
Thanks.
Attachments
File | Date | Size |
---|---|---|
resources.zip | 2011-04-15T03:23:31.000+0000 | 118873 |
Associated Helpdesk Ticket
http://developer.appcelerator.com/helpdesk/view/62271">http://developer.appcelerator.com/helpdesk/view/62271
We have an enterprise client and a premium client pushing for consistency as well.
Thank you for the escalation.
To be discussed next week to identify the underlying issue.
Attached is an example project showing the issue. I don't know if the example is overkill but this is how I am seeing the problem with another project.
The file contained in /include/folder2/other_file.js has the following:
I've built and tested this using mobilesdk-1.6.0-20110106161536-osx.zip.
I'm guessing the issue it somewhere in loadAppResource method, but who knows... Going to try to figure something out tomorrow.
This ticket is also probably related to LH #1986. Same failure/results for images specified with absolute urls.
I have two projects at a stand still due to this bug. Is there a current ETA for this issue to be resolved?
So, the work-around would be be use case statement around each include()?
ie: if( Utils.isIOS() ) { Ti.include('include/utils/dashboard.js') } else { Ti.include('utils/dashboard.js') }
from ticket #62271
Just to summarize paths for images, this has just been tested on iOS 4.2 / Ti 1.6.0 (3 Feb 2011) with the following results for both the
image
andbackgroundImage
properties of imageView (using the simple project attached):The same code and tests on Android APIs 2.2 / Ti 1.6.0 (2 Feb 2011) work for all of the above 4 paths.
Note, I have not tested a relative parent path (double-dot and slash), ie
../
I've updated the ticket so that it is properly tagged, given that their is HD interest and enterprise interest in its resolution.
Unofficial Workaround
Unofficially (aka unsupported, at least through here), you might want to take a look at the work I did on the redux library's "include" function. It lets you do absolute includes on both Android and iOS from any folder, to any folder. It may be a suitable workaround until the core code is fixed.
Here is a link straight to the relevant function. It isn't reliant on any other functions in redux, so it should be easy to rip out. It operates off of what the platform osname is and the depth of the currentWindow's url.
https://github.com/dawsontoth/Appcelerator-Titanium-Redux/blob/master/redux.js#L164"> https://github.com/dawsontoth/Appcelerator-Titanium-Redux/blob/mast...
Another customer interested in this
Associated Helpdesk Ticket
http://developer.appcelerator.com/helpdesk/view/74251">http://developer.appcelerator.com/helpdesk/view/74251
Can more information related to this bug be released to the community/paid devs? ETA maybe?
Bill, We'll probably need to generate or find the iOS ticket that goes with this. Drillbit tests of correct behavior will speed the iOS fixes.
(from [b1ea8d3e0c31c5078f52380552b078d9eb3b0d25]) New "includes" drillbit test suite to test Ti.include() [#2585] https://github.com/appcelerator/titanium_mobile/commit/b1ea8d3e0c31c5078f52380552b078d9eb3b0d25"> https://github.com/appcelerator/titanium_mobile/commit/b1ea8d3e0c31...
Related commit: https://github.com/appcelerator/titanium_mobile/commit/dbac80a64d0dec1ce02d327f21226ad9aac6483d"> https://github.com/appcelerator/titanium_mobile/commit/dbac80a64d0d...
QE: This is the Android ticket re pathing in Ti.include(). A set of drillbit tests to be sure that Ti.include() can handle relative and absolute pathing has been added to drillbit (see the "includes" test suite in drillbit.) Android passes those tests but at that moment iOS doesn't. iOS will be handled in ticket #3349, so for purposes of setting this to resolved you need only test the Android part in drillbit.
Interested parties follow #3349 for the iOS part.
Tested with Titanium SDK version: 1.7.0 (03/15/11 11:42 1f6dbfe)
Ran Drillbit on Emulator 2.1, ran includes test suite all pass
relativeDown true 9 Success
slashToRoot true 16 Success
dotdotSlash true 23 Success
dotSlash true 23 Success
lotsOfDots true 37 Success
(from [dbac80a64d0dec1ce02d327f21226ad9aac6483d]) Re-work absoluteUrl() to better handle relative pathing for includes and such. [#2585] https://github.com/appcelerator/titanium_mobile/commit/dbac80a64d0dec1ce02d327f21226ad9aac6483d"> https://github.com/appcelerator/titanium_mobile/commit/dbac80a64d0d...
Since a new iOS ticket has been created, converting this to Android only.