{ "id": "108436", "key": "TIMOB-13496", "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": "15498", "description": "2013 Sprint 12 API", "name": "2013 Sprint 12 API", "archived": true, "released": true, "releaseDate": "2013-06-17" }, { "id": "15110", "description": "2013 Sprint 12", "name": "2013 Sprint 12", "archived": true, "released": true, "releaseDate": "2013-06-17" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-06-04T20:36:22.000+0000", "created": "2013-01-23T16:19:02.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "module_media", "qe-testadded" ], "versions": [ { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-10-15T10:04:48.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" } ], "description": "The following code fails:\r\n\r\nTitanium.Contacts.removeGroup(groupObj);\r\nTitanium.Contacts.save();\r\n\r\nThe error given is:\r\n{code:title=Error|borderStyle=solid}\r\n[ERROR] : \b\b \bInvalid type passed to function. expected: TiContactsPerson, was: TiContactsGroup in -[ContactsModule removePerson:] (ContactsModule.m:431)\r\n{code}\r\nLooking at ContactsModule.m it appears there may be a bug in removeGroup -- it seems to be using code from removePerson. See below:\r\n{code:title=removeGroup|borderStyle=solid}\r\n-(void)removeGroup:(id)arg\r\n{\r\n\tENSURE_SINGLE_ARG(arg,TiContactsGroup)\r\n\tENSURE_UI_THREAD(removePerson,arg)\r\n\r\n\t[self removeRecord:[arg record]];\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Titanium.Contacts.removeGroup fails", "creator": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium Mobile 3.0.2 GA, 3.1 CI\r\niOS 6 Simulator", "comment": { "comments": [ { "id": "245575", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Please provide a runnable sample app.js", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-04-03T22:36:56.000+0000", "updated": "2013-04-03T22:36:56.000+0000" }, { "id": "245605", "author": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{code:title=Bar.java|borderStyle=solid}\r\nvar win = Titanium.UI.createWindow({ \r\n backgroundColor:\"#fff\",\r\n layout:\"vertical\"\r\n});\r\n\r\nfunction createGroup()\r\n{\r\n\tvar newGroup = Titanium.Contacts.createGroup();\r\n\tnewGroup.name = \"Test Group 1\";\r\n\tTitanium.Contacts.save();\t\r\n}\r\nfunction removeGroup()\r\n{\r\n\tvar allGroups = Titanium.Contacts.getAllGroups();\r\n\tfor (var i=0; i < allGroups.length; i++)\r\n\t{\r\n\t\tTi.API.info(\"found group name: \" + allGroups[i].name);\r\n\t\tif (allGroups[i].name == \"Test Group 1\")\r\n\t\t{\r\n\t\t\tTitanium.Contacts.removeGroup(allGroups[i]);\r\n\t\t}\r\n\t}\r\n\tTitanium.Contacts.save();\r\n}\r\n\r\nvar createButton = Ti.UI.createButton({title:\"Create Group: Test Group 1\",top:20});\r\nvar removeButton = Ti.UI.createButton({title:\"Remove Group: Test Group 1\",top:20});\r\ncreateButton.addEventListener(\"click\",createGroup);\r\nremoveButton.addEventListener(\"click\",removeGroup);\r\n\r\nwin.add(createButton);\r\nwin.add(removeButton);\r\n\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-03T23:22:08.000+0000", "updated": "2013-06-04T20:37:15.000+0000" }, { "id": "245610", "author": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Running the app.js above gives the error:\r\n\r\n[ERROR] : \b\b \bInvalid type passed to function. expected: TiContactsPerson, was: TiContactsGroup in -[ContactsModule removePerson:] (ContactsModule.m:431)\r\n\r\nThis error is not trappable via a try/catch block, though, since it's thrown at the lower (module) level.\r\n", "updateAuthor": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-03T23:26:12.000+0000", "updated": "2013-04-03T23:27:09.000+0000" }, { "id": "246457", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Confirmed with 3.0.2 GA, but the issue is fixed in 3.1.0.v20130403114957.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-08T18:36:17.000+0000", "updated": "2013-04-08T18:36:17.000+0000" }, { "id": "246639", "author": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As of 3.1.0.v20130405170202, this is still not working for us.", "updateAuthor": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-09T16:04:24.000+0000", "updated": "2013-04-09T16:04:24.000+0000" }, { "id": "246640", "author": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Here is updated test code that shows it is not fixed:\n\n{code:title=Bar.java|borderStyle=solid}\nvar win = Titanium.UI.createWindow({ \n backgroundColor:\"#fff\",\n layout:\"vertical\"\n});\n\nfunction createGroup()\n{\n\tvar newGroup = Titanium.Contacts.createGroup();\n\tnewGroup.name = \"Test Group 2\";\n\tTitanium.Contacts.save();\t\n\tTi.API.info(\"********************\");\n\tTi.API.info(\"Listing groups:\");\n\tTi.API.info(\"********************\");\n\tallGroups = Titanium.Contacts.getAllGroups();\n\tfor (var i=0; i < allGroups.length; i++)\n\t{\n\t\tTi.API.info(\"found group name: \" + allGroups[i].name);\n\t}\t\n\tTi.API.info(\"********************\");\n\tTi.API.info(\"done\");\n\tTi.API.info(\"********************\");\t\n}\nfunction removeGroup()\n{\n\tvar allGroups = Titanium.Contacts.getAllGroups();\n\tfor (var i=0; i < allGroups.length; i++)\n\t{\n\t\tTi.API.info(\"found group name: \" + allGroups[i].name);\n\t\tif (allGroups[i].name == \"Test Group 2\")\n\t\t{\n\t\t\tTi.API.info(\"deleting group: Test Group 2\");\n\t\t\tTitanium.Contacts.removeGroup(allGroups[i]);\n\t\t\tTitanium.Contacts.save();\n\t\t}\n\t}\t\n\tTi.API.info(\"********************\");\n\tTi.API.info(\"Listing groups again\");\n\tTi.API.info(\"********************\");\n\tallGroups = Titanium.Contacts.getAllGroups();\n\tfor (var i=0; i < allGroups.length; i++)\n\t{\n\t\tTi.API.info(\"found group name: \" + allGroups[i].name);\n\t}\t\n\tTi.API.info(\"********************\");\n\tTi.API.info(\"done\");\n\tTi.API.info(\"********************\");\n\t\n}\n\nvar createButton = Ti.UI.createButton({title:\"Create Group: Test Group 2\",top:20});\nvar removeButton = Ti.UI.createButton({title:\"Remove Group: Test Group 2\",top:20});\ncreateButton.addEventListener(\"click\",createGroup);\nremoveButton.addEventListener(\"click\",removeGroup);\n\nwin.add(createButton);\nwin.add(removeButton);\n\nwin.open();\n\n{code}", "updateAuthor": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-09T16:12:41.000+0000", "updated": "2013-04-09T16:12:41.000+0000" }, { "id": "246647", "author": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Note that, beginning in SDK 3.1, the original error message reported no longer appears. No error is given -- the method simply does not delete the group as it's supposed to.", "updateAuthor": { "name": "markb@mantisbible.com", "key": "markb@mantisbible.com", "displayName": "Mark Burggraf", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-09T17:14:21.000+0000", "updated": "2013-04-09T17:14:21.000+0000" }, { "id": "246650", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ok, confirmed. Our engineering team will review. Thanks.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-09T17:16:28.000+0000", "updated": "2013-04-09T17:16:28.000+0000" }, { "id": "255928", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Fixed in master (3.2.0) by PR https://github.com/appcelerator/titanium_mobile/pull/3884", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-06-04T20:36:22.000+0000", "updated": "2013-06-04T20:36:22.000+0000" }, { "id": "275112", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Group is getting removed on the invocation of Titanium.Contacts.removeGroup\r\n\r\nVerified fix on:\r\nDevice : iPhone 5 , iOS version : 7.0\r\nDevice : iPod Touch , iOS version : 6.1.3\r\nSDK: 3.2.0.v20131014204636\r\nCLI version : 3.2.0\r\nOS : MAC OSX 10.8.4\r\nAlloy : 1.2.2\r\nAppcelerator Studio, build: 3.2.0.201310112258\r\nXCode : 5", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-10-15T09:52:13.000+0000", "updated": "2013-10-15T09:52:13.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }