{ "id": "155773", "key": "ALOY-1369", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "17983", "name": "alloy 1.8.1", "archived": false, "released": true, "releaseDate": "2016-03-22" }, { "id": "18001", "name": "Release 5.2.2", "archived": false, "released": true, "releaseDate": "2016-06-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-03-21T19:21:46.000+0000", "created": "2016-03-16T12:55:32.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "17748", "name": "alloy 1.7.35", "archived": false, "released": true, "releaseDate": "2016-02-29" } ], "issuelinks": [ { "id": "51077", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "155771", "key": "ALOY-1368", "fields": { "summary": "Complex data binding for individual model doesn't work with transform() method", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "51162", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "159078", "key": "ALOY-1474", "fields": { "summary": "Regression: Model data binding no longer works", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "51176", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "159105", "key": "ALOY-1477", "fields": { "summary": "Regression: Missing model attributes cause error on collection data binding", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "51078", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "107000", "key": "ALOY-443", "fields": { "summary": "Enable more complex notation in binding", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "updated": "2016-03-31T22:39:53.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": "13605", "name": "Models" }, { "id": "12326", "name": "XML", "description": "View XML and parsing" } ], "description": "The complex data binding introduced by ALOY-443 does not work if the model has a {{__transform}} property:\r\n\r\n{code:xml}\r\n\r\n\t\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nCompiles to:\r\n\r\n{code:js}\r\n __alloyId3.__transform = {};\r\n var __alloyId5 = Ti.UI.createTableViewRow({\r\n foo: typeof __alloyId3.__transform['a'] !== 'undefined' ? __alloyId3.__transform['a'] : __alloyId3.get('a'),\r\n bar: typeof __alloyId3.__transform['a'] !== 'undefined' ? __alloyId3.__transform['a'] : the '+__alloyId3.get('\r\n a ') +',\r\n title: typeof __alloyId3.__transform['a'] !== 'undefined' ? __alloyId3.__transform['a'] : __alloyId3.get('a') + ' ' + __alloyId3.get('b'),\r\n });\r\n{code}\r\n\r\nWhich will cause Uglify to crash on the syntax error on line 3.\r\n\r\nFor the other 2 cases the values will always that of {{a}} if the model has a {{__transform}} property.\r\n\r\nThe correct code should be:\r\n\r\n{code:js}\r\n __alloyId3.__transform = _.isFunction(__alloyId3.transform) ? __alloyId3.transform() : __alloyId3.toJSON();\r\n var __alloyId5 = Ti.UI.createTableViewRow({\r\n foo: _.template(\"<%=a%>\", __alloyId3.__transform),\r\n bar: _.template(\"<%=the a%>\", __alloyId3.__transform),\r\n title: _.template(\"<%=a b%>\", __alloyId3.__transform)\r\n });\r\n{code}", "attachment": [], "flagged": false, "summary": "Complex data binding for collection doesn't work with transform", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "Alloy 1.7.35", "comment": { "comments": [ { "id": "379884", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "PR: https://github.com/appcelerator/alloy/pull/769", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-03-16T16:14:14.000+0000", "updated": "2016-03-16T16:14:14.000+0000" }, { "id": "381242", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed, using:\r\n\r\nMacOS 10.11.4 (15E65)\r\nStudio 4.5.0.201602170821\r\nTi SDK 5.2.2.v20160328141205\r\nAppc NPM 4.2.5-1\r\nAppc CLI 5.2.2-3\r\nAlloy 1.8.5\r\nXcode 7.3 (7D175)\r\n\r\nComplex data binding for collections using transform are working as expected. Tested using the project in ALOY-1474 as well as custom apps using collections with transform functions. Code generated matches the form of the correct code in ticket description.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-03-31T22:39:53.000+0000", "updated": "2016-03-31T22:39:53.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }