{ "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! :-)

\n

I have broken my app into small, manageable pieces and link\nthings together using Titanium.include and the 'url' property when\ncreating a new window.

\n

Both 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.

\n

Can 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.

\n

Thanks.

{html}", "attachment": [ { "id": "18168", "filename": "resources.zip", "author": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:31.000+0000", "size": 118873, "mimeType": "application/zip" } ], "flagged": false, "summary": "Include paths for iphone and android are not based on the same starting point", "creator": { "name": "pault", "key": "pault", "displayName": "PaulT", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pault", "key": "pault", "displayName": "PaulT", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "128859", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "{html}

Associated Helpdesk Ticket

\n

http://developer.appcelerator.com/helpdesk/view/62271

\n

We have an enterprise client and a premium client pushing for\nconsistency as well.

{html}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-04-15T03:23:31.000+0000", "updated": "2011-04-15T03:23:31.000+0000" }, { "id": "128860", "author": { "name": "johnwelch", "key": "johnwelch", "displayName": "John Welch", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Thank you for the escalation.

{html}", "updateAuthor": { "name": "johnwelch", "key": "johnwelch", "displayName": "John Welch", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:32.000+0000", "updated": "2011-04-15T03:23:32.000+0000" }, { "id": "128861", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

To be discussed next week to identify the underlying issue.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:32.000+0000", "updated": "2011-04-15T03:23:32.000+0000" }, { "id": "128862", "author": { "name": "johnwelch", "key": "johnwelch", "displayName": "John Welch", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

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.

\n

The 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
\n

I've built and tested this using\nmobilesdk-1.6.0-20110106161536-osx.zip.

\n

I'm guessing the issue it somewhere in loadAppResource method,\nbut who knows... Going to try to figure something out tomorrow.

{html}", "updateAuthor": { "name": "johnwelch", "key": "johnwelch", "displayName": "John Welch", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:32.000+0000", "updated": "2011-04-15T03:23:32.000+0000" }, { "id": "128863", "author": { "name": "andreassandberg", "key": "andreassandberg", "displayName": "Andreas sandberg", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

This ticket is also probably related to LH #1986. Same\nfailure/results for images specified with absolute urls.

{html}", "updateAuthor": { "name": "andreassandberg", "key": "andreassandberg", "displayName": "Andreas sandberg", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:32.000+0000", "updated": "2011-04-15T03:23:32.000+0000" }, { "id": "128864", "author": { "name": "johnwelch", "key": "johnwelch", "displayName": "John Welch", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I have two projects at a stand still due to this bug. Is there a\ncurrent ETA for this issue to be resolved?

{html}", "updateAuthor": { "name": "johnwelch", "key": "johnwelch", "displayName": "John Welch", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:32.000+0000", "updated": "2011-04-15T03:23:32.000+0000" }, { "id": "128865", "author": { "name": "indy", "key": "indy", "displayName": "Indy", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

So, the work-around would be be use case statement around each\ninclude()?

\n

ie: if( Utils.isIOS() ) {\nTi.include('include/utils/dashboard.js') } else {\nTi.include('utils/dashboard.js') }

\n

from ticket #62271

{html}", "updateAuthor": { "name": "indy", "key": "indy", "displayName": "Indy", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:33.000+0000", "updated": "2011-04-15T03:23:33.000+0000" }, { "id": "128866", "author": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

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):

\n
\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
\n

The same code and tests on Android APIs 2.2 / Ti 1.6.0 (2 Feb\n2011) work for all of the above 4 paths.

\n

Note, I have not tested a relative parent path (double-dot and\nslash), ie ../

{html}", "updateAuthor": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:33.000+0000", "updated": "2011-04-15T03:23:33.000+0000" }, { "id": "128867", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "{html}

I've updated the ticket so that it is properly tagged, given\nthat their is HD interest and enterprise interest in its\nresolution.

\n

Unofficial Workaround

\n

Unofficially (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.

\n

Here 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...

{html}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-04-15T03:23:33.000+0000", "updated": "2011-04-15T03:23:33.000+0000" }, { "id": "128868", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Another customer interested in this

\n

Associated Helpdesk Ticket

\n

http://developer.appcelerator.com/helpdesk/view/74251

{html}", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:34.000+0000", "updated": "2011-04-15T03:23:34.000+0000" }, { "id": "128869", "author": { "name": "johnwelch", "key": "johnwelch", "displayName": "John Welch", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Can more information related to this bug be released to the\ncommunity/paid devs? ETA maybe?

{html}", "updateAuthor": { "name": "johnwelch", "key": "johnwelch", "displayName": "John Welch", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:34.000+0000", "updated": "2011-04-15T03:23:34.000+0000" }, { "id": "128870", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

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.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:35.000+0000", "updated": "2011-04-15T03:23:35.000+0000" }, { "id": "128871", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [b1ea8d3e0c31c5078f52380552b078d9eb3b0d25])\nNew \"includes\" drillbit test suite to test Ti.include() [#2585]\n\nhttps://github.com/appcelerator/titanium_mobile/commit/b1ea8d3e0c31...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:23:35.000+0000", "updated": "2011-04-15T03:23:35.000+0000" }, { "id": "128872", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

Related commit: \nhttps://github.com/appcelerator/titanium_mobile/commit/dbac80a64d0d...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:23:36.000+0000", "updated": "2011-04-15T03:23:36.000+0000" }, { "id": "128873", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

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.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:23:36.000+0000", "updated": "2011-04-15T03:23:36.000+0000" }, { "id": "128874", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

Interested parties follow #3349 for the iOS part.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:23:36.000+0000", "updated": "2011-04-15T03:23:36.000+0000" }, { "id": "128875", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

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

{html}", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:37.000+0000", "updated": "2011-04-15T03:23:37.000+0000" }, { "id": "128876", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [dbac80a64d0dec1ce02d327f21226ad9aac6483d])\nRe-work absoluteUrl() to better handle relative pathing for\nincludes and such. [#2585] \nhttps://github.com/appcelerator/titanium_mobile/commit/dbac80a64d0d...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:23:37.000+0000", "updated": "2011-04-15T03:23:37.000+0000" }, { "id": "128877", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Since a new iOS ticket has been created, converting this to\nAndroid only.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:38.000+0000", "updated": "2011-04-15T03:23:38.000+0000" } ], "maxResults": 19, "total": 19, "startAt": 0 } } }