{ "id": "63217", "key": "TIMOB-2585", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11245", "name": "Sprint 2011-10", "archived": true, "released": true, "releaseDate": "2011-03-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:59:31.000+0000", "created": "2011-04-15T03:23:30.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "defect", "enterprise", "klist", "release-1.7.0", "reported-1.5.0", "rplist" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:59:31.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}
This issue is making me nuts! :-)
\nI have broken my app into small, manageable pieces and link\nthings together using Titanium.include and the 'url' property when\ncreating a new window.
\nBoth of these require a 'path' to a .js file. The trouble is,\none platform seems to want it relative to the root and the other\nrelative to where the file is being included from. The url property\nused to be the same (iphone vs android) until 1.5, but after I\nupgraded today I found that it had changed on android requiring me\nto fiddle the paths to get the app working again.
\nCan we please have it one way or the other on all platforms? I\nam trying to build a core of code that will work across all\nplatforms and having to deal with varying path models is just\nmaking my code that much more complex.
\nThanks.
http://developer.appcelerator.com/helpdesk/view/62271
\nWe have an enterprise client and a premium client pushing for\nconsistency 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\nif the example is overkill but this is how I am seeing the problem\nwith another project.
\nThe file contained in /include/folder2/other_file.js has the\nfollowing:
\n\n// This works for iPhone: \n// Titanium.include(\"../../include/folder/file.js\");\n\n// This works for Android & errors for iPhone:\nTitanium.include(\"/include/folder/file.js\");\n\nalert(\"A variable != \" + theMessage);
\n
\nI've built and tested this using\nmobilesdk-1.6.0-20110106161536-osx.zip.
\nI'm guessing the issue it somewhere in loadAppResource method,\nbut who knows... Going to try to figure something out tomorrow.
This ticket is also probably related to LH #1986. Same\nfailure/results for images specified with absolute urls.
I have two projects at a stand still due to this bug. Is there a\ncurrent ETA for this issue to be resolved?
So, the work-around would be be use case statement around each\ninclude()?
\nie: if( Utils.isIOS() ) {\nTi.include('include/utils/dashboard.js') } else {\nTi.include('utils/dashboard.js') }
\nfrom ticket #62271
Just to summarize paths for images, this has\njust been tested on iOS 4.2 / Ti 1.6.0 (3 Feb 2011) with the\nfollowing results for both the image
and\nbackgroundImage
properties of imageView (using the\nsimple project attached):
\nimage: 'card/'+i+'.png', // no leading slash (relative) works\nimage: './card/'+i+'.png', // leading dot and slash works\nimage: '/card/'+i+'.png', // leading slash does *not* work\nimage: 'app://card/'+i+'.png', // leading \"app://\" does *not* work
\n
\nThe same code and tests on Android APIs 2.2 / Ti 1.6.0 (2 Feb\n2011) work for all of the above 4 paths.
\nNote, I have not tested a relative parent path (double-dot and\nslash), ie ../
I've updated the ticket so that it is properly tagged, given\nthat their is HD interest and enterprise interest in its\nresolution.
\nUnofficially (aka unsupported, at least through here), you might\nwant to take a look at the work I did on the redux library's\n\"include\" function. It lets you do absolute includes on both\nAndroid and iOS from any folder, to any folder. It may be a\nsuitable workaround until the core code is fixed.
\nHere is a link straight to the relevant function. It isn't\nreliant on any other functions in redux, so it should be easy to\nrip out. It operates off of what the platform osname is and the\ndepth of the currentWindow's url.
\n\nhttps://github.com/dawsontoth/Appcelerator-Titanium-Redux/blob/mast...
Another customer interested in this
Can more information related to this bug be released to the\ncommunity/paid devs? ETA maybe?
Bill, We'll probably need to generate or find the iOS ticket\nthat goes with this. Drillbit tests of correct behavior will speed\nthe iOS fixes.
(from [b1ea8d3e0c31c5078f52380552b078d9eb3b0d25])\nNew \"includes\" drillbit test suite to test Ti.include() [#2585]\n\nhttps://github.com/appcelerator/titanium_mobile/commit/b1ea8d3e0c31...
QE: This is the Android ticket re pathing in Ti.include(). A set\nof drillbit tests to be sure that Ti.include() can handle relative\nand absolute pathing has been added to drillbit (see the \"includes\"\ntest suite in drillbit.) Android passes those tests but at that\nmoment iOS doesn't. iOS will be handled in ticket #3349, so\nfor purposes of setting this to resolved you need only test the\nAndroid part in drillbit.
Interested parties follow #3349 for the iOS part.
Tested with Titanium SDK version: 1.7.0 (03/15/11 11:42\n1f6dbfe)
\nRan Drillbit on Emulator 2.1, ran includes test suite all pass
\nrelativeDown true 9 Success
\nslashToRoot true 16 Success
\ndotdotSlash true 23 Success
\ndotSlash true 23 Success
\nlotsOfDots true 37 Success
(from [dbac80a64d0dec1ce02d327f21226ad9aac6483d])\nRe-work absoluteUrl() to better handle relative pathing for\nincludes and such. [#2585] \nhttps://github.com/appcelerator/titanium_mobile/commit/dbac80a64d0d...
Since a new iOS ticket has been created, converting this to\nAndroid only.