{ "id": "63174", "key": "TIMOB-2542", "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": "11230", "name": "Release 1.5.0 M05", "archived": true, "released": true, "releaseDate": "2010-12-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:59:24.000+0000", "created": "2011-04-15T03:22:15.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "enterprise" ], "versions": [], "issuelinks": [], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2011-04-17T01:59:24.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}
Using 1.5 \ncontinuous build (Dec. 9), I confirm that\nTi.Contacts.createPerson
is undefined for the\nTi.Contacts namespace. This is a documentation or a functional bug\nto be addressed. Code that should work:
\n\nvar contacts = Ti.Contacts.getPeopleWithName('Johnson');\nvar contact = Ti.Contacts.createPerson();\ncontact.firstName = 'John';\ncontact.lastName = 'Smith';\ncontact.phone = {'work':['5555555555']};\ncontact.email = {'work':['foo@bar.com']};\ncontact.address = {\n 'home':[{\n street: '555 Happy Drive',\n city: 'Saint Paul',\n state: 'MN',\n postalCode: '55119',\n country: 'US'\n }]\n};\nTi.Contacts.save();\nTi.API.info('Contact added');
\n
\nProduces:
\n\n[TRACE] E/KrollContext( 400): (kroll$1) [127,940] ECMA Error evaluating source: TypeError: Cannot find function createPerson in object [Ti.Contacts]. (app://app.js#1)\n[TRACE] E/KrollContext( 400): org.mozilla.javascript.EcmaError: TypeError: Cannot find function createPerson in object [Ti.Contacts]. (app://app.js#1)\n[TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3761)\n[TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3739)\n[TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3767)\n[TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3786)\n[TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3850)\n[TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2343)\n[TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2310)\n[TRACE] E/KrollContext( 400): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1524)\n[TRACE] E/KrollContext( 400): at script(app://app.js:1)\n[TRACE] E/KrollContext( 400): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)\n[TRACE] E/KrollContext( 400): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)\n[TRACE] E/KrollContext( 400): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)\n[TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3161)\n[TRACE] E/KrollContext( 400): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)\n[TRACE] E/KrollContext( 400): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142)\n[TRACE] E/KrollContext( 400): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:195)\n[TRACE] E/KrollContext( 400): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:220)\n[TRACE] E/KrollContext( 400): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:115)\n[TRACE] E/KrollContext( 400): at android.os.Handler.dispatchMessage(Handler.java:95)\n[TRACE] E/KrollContext( 400): at android.os.Looper.loop(Looper.java:123)\n[TRACE] E/KrollContext( 400): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:73)\n[TRACE] E/TiContext( 400): (kroll$1) [24,964] Rhino Error: app://app.js:1,0\n[TRACE] E/TiContext( 400): (kroll$1) [2,966] Message: TypeError: Cannot find function createPerson in object [Ti.Contacts]. (app://app.js#1)\n[TRACE] E/TiContext( 400): (kroll$1) [1,967] Source: null
\n
#1894 is for read-write contacts. Will update\ndocumentation, however.
(from [b8f0c4d69b3999f794ef110f0dae90dc7a7b77e4])\n[#2542 state:fixed-in-qa] Documentation fix only.\nAdd notations that contacts in android are currently only\nread-only. Ticket 1894 addresses adding read-write functionality.\n\nhttps://github.com/appcelerator/titanium_mobile/commit/b8f0c4d69b39...