{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/Vellum/pulls/comments/40554760","id":40554760,"diff_hunk":"@@ -643,12 +645,31 @@ define([\n         };\n \n         widget.equivalentOption = function (val) {\n-            val = val ? JSON.parse(val) : '';\n+            function parseValue (val) {\n+                try {\n+                    return JSON.parse(val);\n+                } catch(err) {\n+                    return  val;\n+                }\n+            }\n+\n+            val = parseValue(val);\n             return _.find(widget.getOptions(), function (option) {\n-                return _.isEqual(option.value ? JSON.parse(option.value) : '', val);\n+                return _.isEqual(parseValue(option.value), val);\n             });\n         };\n \n+        widget.findOrAddCustom = function (value) {","path":"src/widgets.js","position":64,"original_position":64,"commit_id":"96cd22d060e9ef696fa6043f444c2bf5a688ad30","original_commit_id":"96cd22d060e9ef696fa6043f444c2bf5a688ad30","user":{"login":"orangejenny","id":1486591,"avatar_url":"https://avatars.githubusercontent.com/u/1486591?v=3","gravatar_id":"","url":"https://api.github.com/users/orangejenny","html_url":"https://github.com/orangejenny","followers_url":"https://api.github.com/users/orangejenny/followers","following_url":"https://api.github.com/users/orangejenny/following{/other_user}","gists_url":"https://api.github.com/users/orangejenny/gists{/gist_id}","starred_url":"https://api.github.com/users/orangejenny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orangejenny/subscriptions","organizations_url":"https://api.github.com/users/orangejenny/orgs","repos_url":"https://api.github.com/users/orangejenny/repos","events_url":"https://api.github.com/users/orangejenny/events{/privacy}","received_events_url":"https://api.github.com/users/orangejenny/received_events","type":"User","site_admin":false},"body":"super picky, but `findOrAddCustom` sounds like it returns something, either a boolean or the custom option. `addCustomIfNeeded`?","created_at":"2015-09-28T14:01:02Z","updated_at":"2015-09-28T14:01:02Z","html_url":"https://github.com/dimagi/Vellum/pull/538#discussion_r40554760","pull_request_url":"https://api.github.com/repos/dimagi/Vellum/pulls/538","_links":{"self":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/comments/40554760"},"html":{"href":"https://github.com/dimagi/Vellum/pull/538#discussion_r40554760"},"pull_request":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/538"}}},"pull_request":{"url":"https://api.github.com/repos/dimagi/Vellum/pulls/538","id":46046326,"html_url":"https://github.com/dimagi/Vellum/pull/538","diff_url":"https://github.com/dimagi/Vellum/pull/538.diff","patch_url":"https://github.com/dimagi/Vellum/pull/538.patch","issue_url":"https://api.github.com/repos/dimagi/Vellum/issues/538","number":538,"state":"open","locked":false,"title":"Improve intent paywall","user":{"login":"emord","id":1471773,"avatar_url":"https://avatars.githubusercontent.com/u/1471773?v=3","gravatar_id":"","url":"https://api.github.com/users/emord","html_url":"https://github.com/emord","followers_url":"https://api.github.com/users/emord/followers","following_url":"https://api.github.com/users/emord/following{/other_user}","gists_url":"https://api.github.com/users/emord/gists{/gist_id}","starred_url":"https://api.github.com/users/emord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emord/subscriptions","organizations_url":"https://api.github.com/users/emord/orgs","repos_url":"https://api.github.com/users/emord/repos","events_url":"https://api.github.com/users/emord/events{/privacy}","received_events_url":"https://api.github.com/users/emord/received_events","type":"User","site_admin":false},"body":"http://manage.dimagi.com/default.asp?181125#1017696\r\n\r\nTrying to load a form with an intent to a community plan:\r\n![selection_050](https://cloud.githubusercontent.com/assets/1471773/10109649/29ad433c-6396-11e5-909d-bf22f3161e2e.png)\r\n\r\nCustom intents with a templated intent:\r\n![selection_051](https://cloud.githubusercontent.com/assets/1471773/10109646/29ac7240-6396-11e5-8f4a-c697b12b26d3.png)\r\n\r\nCustom intent:\r\n![selection_052](https://cloud.githubusercontent.com/assets/1471773/10109648/29ad3b9e-6396-11e5-8c57-398dd061c0ad.png)\r\n\r\n\r\n@dimagi/product Just the vellum changes. doesn't actually block the build atm. Based the error text on the lookup table error message\r\n\r\n@orangejenny @TylerSheffels ","created_at":"2015-09-25T19:03:19Z","updated_at":"2015-09-28T14:01:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7223aa51edb6ab98d03b9b158de6b661efb62318","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dimagi/Vellum/pulls/538/commits","review_comments_url":"https://api.github.com/repos/dimagi/Vellum/pulls/538/comments","review_comment_url":"https://api.github.com/repos/dimagi/Vellum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimagi/Vellum/issues/538/comments","statuses_url":"https://api.github.com/repos/dimagi/Vellum/statuses/96cd22d060e9ef696fa6043f444c2bf5a688ad30","head":{"label":"dimagi:fix-intent-paywall","ref":"fix-intent-paywall","sha":"96cd22d060e9ef696fa6043f444c2bf5a688ad30","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":1859793,"name":"Vellum","full_name":"dimagi/Vellum","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/Vellum","description":"An XForms form designer written purely in Javascript","fork":false,"url":"https://api.github.com/repos/dimagi/Vellum","forks_url":"https://api.github.com/repos/dimagi/Vellum/forks","keys_url":"https://api.github.com/repos/dimagi/Vellum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/Vellum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/Vellum/teams","hooks_url":"https://api.github.com/repos/dimagi/Vellum/hooks","issue_events_url":"https://api.github.com/repos/dimagi/Vellum/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/Vellum/events","assignees_url":"https://api.github.com/repos/dimagi/Vellum/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/Vellum/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/Vellum/tags","blobs_url":"https://api.github.com/repos/dimagi/Vellum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/Vellum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/Vellum/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/Vellum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/Vellum/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/Vellum/languages","stargazers_url":"https://api.github.com/repos/dimagi/Vellum/stargazers","contributors_url":"https://api.github.com/repos/dimagi/Vellum/contributors","subscribers_url":"https://api.github.com/repos/dimagi/Vellum/subscribers","subscription_url":"https://api.github.com/repos/dimagi/Vellum/subscription","commits_url":"https://api.github.com/repos/dimagi/Vellum/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/Vellum/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/Vellum/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/Vellum/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/Vellum/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/Vellum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/Vellum/merges","archive_url":"https://api.github.com/repos/dimagi/Vellum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/Vellum/downloads","issues_url":"https://api.github.com/repos/dimagi/Vellum/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/Vellum/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/Vellum/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/Vellum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/Vellum/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/Vellum/releases{/id}","created_at":"2011-06-07T13:03:34Z","updated_at":"2015-09-25T08:20:08Z","pushed_at":"2015-09-26T15:18:17Z","git_url":"git://github.com/dimagi/Vellum.git","ssh_url":"git@github.com:dimagi/Vellum.git","clone_url":"https://github.com/dimagi/Vellum.git","svn_url":"https://github.com/dimagi/Vellum","homepage":"","size":16977,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":3,"forks":16,"open_issues":3,"watchers":32,"default_branch":"master"}},"base":{"label":"dimagi:master","ref":"master","sha":"47652505cc05b52e3698ff88384a658340393210","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":1859793,"name":"Vellum","full_name":"dimagi/Vellum","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/Vellum","description":"An XForms form designer written purely in Javascript","fork":false,"url":"https://api.github.com/repos/dimagi/Vellum","forks_url":"https://api.github.com/repos/dimagi/Vellum/forks","keys_url":"https://api.github.com/repos/dimagi/Vellum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/Vellum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/Vellum/teams","hooks_url":"https://api.github.com/repos/dimagi/Vellum/hooks","issue_events_url":"https://api.github.com/repos/dimagi/Vellum/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/Vellum/events","assignees_url":"https://api.github.com/repos/dimagi/Vellum/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/Vellum/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/Vellum/tags","blobs_url":"https://api.github.com/repos/dimagi/Vellum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/Vellum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/Vellum/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/Vellum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/Vellum/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/Vellum/languages","stargazers_url":"https://api.github.com/repos/dimagi/Vellum/stargazers","contributors_url":"https://api.github.com/repos/dimagi/Vellum/contributors","subscribers_url":"https://api.github.com/repos/dimagi/Vellum/subscribers","subscription_url":"https://api.github.com/repos/dimagi/Vellum/subscription","commits_url":"https://api.github.com/repos/dimagi/Vellum/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/Vellum/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/Vellum/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/Vellum/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/Vellum/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/Vellum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/Vellum/merges","archive_url":"https://api.github.com/repos/dimagi/Vellum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/Vellum/downloads","issues_url":"https://api.github.com/repos/dimagi/Vellum/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/Vellum/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/Vellum/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/Vellum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/Vellum/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/Vellum/releases{/id}","created_at":"2011-06-07T13:03:34Z","updated_at":"2015-09-25T08:20:08Z","pushed_at":"2015-09-26T15:18:17Z","git_url":"git://github.com/dimagi/Vellum.git","ssh_url":"git@github.com:dimagi/Vellum.git","clone_url":"https://github.com/dimagi/Vellum.git","svn_url":"https://github.com/dimagi/Vellum","homepage":"","size":16977,"stargazers_count":32,"watchers_count":32,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":3,"forks":16,"open_issues":3,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/538"},"html":{"href":"https://github.com/dimagi/Vellum/pull/538"},"issue":{"href":"https://api.github.com/repos/dimagi/Vellum/issues/538"},"comments":{"href":"https://api.github.com/repos/dimagi/Vellum/issues/538/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/538/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/538/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/Vellum/statuses/96cd22d060e9ef696fa6043f444c2bf5a688ad30"}}}}