{ "id": "154112", "key": "TIMOB-20193", "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": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-06-09T21:54:13.000+0000", "created": "2016-01-04T23:51:29.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "iOS", "qe-5.1.2", "qe-5.4.0" ], "versions": [ { "id": "17072", "name": "Release 5.1.2", "archived": false, "released": true, "releaseDate": "2016-01-12" }, { "id": "17532", "name": "Release 5.1.1", "archived": false, "released": true, "releaseDate": "2015-11-24" } ], "issuelinks": [ { "id": "50225", "type": { "id": "10122", "name": "Gantt: start-finish", "inward": "is triggered by", "outward": "is triggering" }, "outwardIssue": { "id": "154115", "key": "TIMOB-20194", "fields": { "summary": "iOS: Ti.Contacts unrecognized selector sent to instance", "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": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-06-09T21:54:41.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "attachment": [], "flagged": false, "summary": "iOS: Ti.Contacts Cannot create a new entry with unsaved changes", "creator": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "environment": "iPhone 6S Device & Simulator (9.2) \r\nMac OSX El Capitan 10.11 (15A284)\r\nStudio: 4.4.0.201511241829\r\nTi SDK: 5.1.2.v20151216190036\r\nAppc NPM: 4.2.2\r\nApp CLI: 5.1.0\r\nNode v4.2.3\r\npreproduction", "closedSprints": [ { "id": 555, "state": "closed", "name": "2016 Sprint 1 SDK", "startDate": "2016-01-02T01:31:50.127Z", "endDate": "2016-01-16T01:31:00.000Z", "completeDate": "2016-01-18T00:52:43.848Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "373869", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/7613\r\n\r\nAlso I see an issue with the test case - {{Ti.Contacts.save()}} should be called after {{Ti.Contacts.removeGroup()}} to commit the changes, not at the end of the loop. Use the following app.js for verifying the PR.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: \"White\"\r\n});\r\n \r\nvar newGroup = null;\r\nvar allGroups = null;\r\nvar failCase = null;\r\n \r\nfunction testCase(){\r\n if(failCase != null) {\r\n return false;\r\n } else{\r\n return true;\r\n }\r\n}\r\n \r\nvar createPerson = Ti.UI.createButton({\r\n title: 'Create Person 1',\r\n top: '35%'\r\n});\r\n \r\ncreatePerson.addEventListener('click', function(){\r\n var newPerson = Ti.Contacts.createPerson({\r\n firstName: 'Testing',\r\n lastName: '123'\r\n \r\n });\r\n \r\n Ti.Contacts.save();\r\n});\r\n \r\nvar createGroup = Ti.UI.createButton({\r\n title: 'Create Test Group 1',\r\n top: '20%',\r\n});\r\n \r\nvar removeGroup = Ti.UI.createButton({\r\n title: 'Remove Test Group 1',\r\n bottom: '20%'\r\n});\r\n \r\nvar findGroup = Ti.UI.createButton({\r\n title: 'Find Test Group 1',\r\n top: '50%'\r\n});\r\n \r\ncreateGroup.addEventListener('click', function(){\r\n newGroup = Ti.Contacts.createGroup();\r\n newGroup.name = \"Test Group 1\";\r\n Ti.API.info(\"Test Group 1 Created!\");\r\n Ti.Contacts.save();\r\n});\r\n \r\nremoveGroup.addEventListener('click', function(){\r\n allGroups = Titanium.Contacts.getAllGroups();\r\n \r\n for (var i = 0; i < allGroups.length; i++) {\r\n Ti.API.info(\"found group name: \" + allGroups[i].name);\r\n if (allGroups[i].name == \"Test Group 1\") {\r\n Ti.Contacts.removeGroup(allGroups[i]);\r\n Ti.Contacts.save(); \r\n Ti.API.info(allGroups[i].name + \" Successfully Removed!\");\r\n failCase = null;\r\n } else {\r\n Ti.API.info(\"Failed to remove group: \" + allGroups[i].name);\r\n failCase = \"Not Found\";\r\n }\r\n }\r\n \r\n});\r\n \r\nfindGroup.addEventListener('click', function(){\r\n allGroups = Titanium.Contacts.getAllGroups();\r\n Ti.Contacts.save();\r\n for (var i = 0; i < allGroups.length; i++) {\r\n Ti.API.info(\"found group name: \" + allGroups[i].name);\r\n \r\n if (allGroups[i].name == \"Test Group 1\") {\r\n Ti.API.info('Test Group 1 Found!');\r\n failCase = null;\r\n \r\n } else if(allGroups[i].name != \"Test Group 1\" || allGroups[i].name == null) {\r\n Ti.API.info('Test Group 1 Not Found');\r\n failCase = \"Not Found\";\r\n }\r\n }\r\n});\r\n \r\nwin.add(createPerson);\r\nwin.add(createGroup);\r\nwin.add(removeGroup);\r\nwin.add(findGroup);\r\nwin.open();\r\n\r\n{code}", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-01-06T03:09:17.000+0000", "updated": "2016-01-06T03:20:21.000+0000" }, { "id": "373872", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FT AND CR approved merging. Thanks Skrilkanth.\r\n\r\nHowever for calling the Ti.Contacts.Save() doesn't work for a single person.If that is indeed a bug, we should create a separate ticket for that. ", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-06T03:56:07.000+0000", "updated": "2016-01-06T03:56:47.000+0000" }, { "id": "374181", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~ssombhatla], Can you add the fix version for this ticket?", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-01-11T18:53:20.000+0000", "updated": "2016-01-11T18:53:20.000+0000" }, { "id": "374511", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~apetkov] Sorry I did not quite understand - Ti.Contacts.Save() doesn't work for a single person. Can you please elaborate or best if you think it is an issue please do create a ticket. Thanks.", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-01-14T03:41:19.000+0000", "updated": "2016-01-14T03:41:19.000+0000" }, { "id": "374605", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~sriks] When calling the save function for a single contact as appose to a group. It doesn't seem to work, however I'm not too familiar with the contact module. So I'm not sure if the save method is indeed meant for a single contact or for groups only. ", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-14T20:54:23.000+0000", "updated": "2016-01-14T20:54:46.000+0000" }, { "id": "387976", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed, I am able to create and remove groups after making changes. \r\n\r\nTested On:\r\niPhone 6S (9.3.2) Device\r\nMac OSX El Capitan 10.11.5 \r\nTi SDK: 5.4.0.v20160608165242\r\nAppc Studio: 4.6.0.201605180604\r\nAppc NPM: 4.2.7.-2\r\nApp CLI: 5.4.0-11\r\nXcode 7.3\r\nNode v4.2.6\r\n\r\n*Closing ticket.*\r\n", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-06-09T21:53:49.000+0000", "updated": "2016-06-09T21:53:49.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }