{"action":"opened","number":4,"pull_request":{"url":"https://api.github.com/repos/onenorth/express-subitem/pulls/4","id":86850640,"html_url":"https://github.com/onenorth/express-subitem/pull/4","diff_url":"https://github.com/onenorth/express-subitem/pull/4.diff","patch_url":"https://github.com/onenorth/express-subitem/pull/4.patch","issue_url":"https://api.github.com/repos/onenorth/express-subitem/issues/4","number":4,"state":"open","locked":false,"title":"Fix DropLink Issues:","user":{"login":"mrunalbrahmbhatt","id":7857050,"avatar_url":"https://avatars.githubusercontent.com/u/7857050?v=3","gravatar_id":"","url":"https://api.github.com/users/mrunalbrahmbhatt","html_url":"https://github.com/mrunalbrahmbhatt","followers_url":"https://api.github.com/users/mrunalbrahmbhatt/followers","following_url":"https://api.github.com/users/mrunalbrahmbhatt/following{/other_user}","gists_url":"https://api.github.com/users/mrunalbrahmbhatt/gists{/gist_id}","starred_url":"https://api.github.com/users/mrunalbrahmbhatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrunalbrahmbhatt/subscriptions","organizations_url":"https://api.github.com/users/mrunalbrahmbhatt/orgs","repos_url":"https://api.github.com/users/mrunalbrahmbhatt/repos","events_url":"https://api.github.com/users/mrunalbrahmbhatt/events{/privacy}","received_events_url":"https://api.github.com/users/mrunalbrahmbhatt/received_events","type":"User","site_admin":false},"body":"1. Dropdown options was not showing in dropdown when source is relative e.g. query:./ancestor::*[@@templatekey = 'company']/roles/*[@@templatekey = 'role'], as it picks up current item as parent item rather than subitem.\r\n\r\nOriginal Code: \r\nprivate Item[] GetSources(Field field)\r\n        {\r\n            using (new LanguageSwitcher(CurrentLanguage))\r\n            {\r\n                return LookupSources.GetItems(**CurrentItem**, field.Source);\r\n            }\r\n        }\r\n\r\nFix:\r\nprivate Item[] GetSources(Item currentItem, Field field)\r\n    {\r\n      using (new LanguageSwitcher(CurrentLanguage))\r\n      {\r\n        return LookupSources.GetItems(**currentItem**, field.Source);\r\n      }\r\n    }\r\n\r\n2. When value is empty it shows error like \"**Value not in the selection list**\".\r\n\r\nOriginal Code:\r\n\r\nprivate string BuildDropdownOptions(Field field, out bool selectionInList)\r\n        {\r\n            var fieldChoices = GetSources(field);\r\n\r\n            var dropdownOptions = new StringBuilder();\r\n\r\n            dropdownOptions.AppendFormat(\"<option value=''{0}></option>\", string.IsNullOrEmpty(field.Value) ? \" selected\" : \"\");\r\n\r\n            selectionInList = false;\r\n\r\n            foreach (var item in fieldChoices)\r\n            {\r\n                selectionInList |= item.ID.ToString() == field.Value;\r\n\r\n                dropdownOptions.AppendFormat(\"<option value='{0}'{2}>{1}</option>\", item.ID, item.DisplayName, item.ID.ToString() == field.Value ? \" selected\" : \"\");\r\n            }\r\n\r\n            if (!selectionInList)\r\n            {\r\n                dropdownOptions.AppendFormat(@\"<OPTGROUP label=\"\"Value not in the selection list.\"\"><OPTION selected value={0}>{0}</OPTION></OPTGROUP>\", field.Value);\r\n            }\r\n\r\n            return dropdownOptions.ToString();\r\n        }\r\n\r\nFix:\r\nprivate string BuildDropdownOptions(Item **subItem**, Field field, out bool selectionInList)\r\n    {\r\n      var fieldChoices = GetSources(subItem, field);\r\n\r\n      var dropdownOptions = new StringBuilder();\r\n\r\n      dropdownOptions.AppendFormat(\"<option value=''{0}></option>\", string.IsNullOrEmpty(field.Value) ? \" selected\" : \"\");\r\n\r\n      selectionInList = false;\r\n\r\n      foreach (var item in fieldChoices)\r\n      {\r\n        selectionInList |= item.ID.ToString() == field.Value;\r\n\r\n        dropdownOptions.AppendFormat(\"<option value='{0}'{2}>{1}</option>\", item.ID, item.DisplayName, item.ID.ToString() == field.Value ? \" selected\" : \"\");\r\n      }\r\n\r\n      **//Special case where none or string is empty.\r\n      if (!selectionInList) selectionInList = string.IsNullOrEmpty(field.Value);**\r\n\r\n      if (!selectionInList)\r\n      {\r\n        dropdownOptions.AppendFormat(@\"<OPTGROUP label=\"\"Value not in the selection list.\"\"><OPTION selected value={0}>{0}</OPTION></OPTGROUP>\", field.Value);\r\n      }\r\n\r\n      return dropdownOptions.ToString();\r\n    }","created_at":"2016-09-27T02:03:52Z","updated_at":"2016-09-27T02:03:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e23c37ef81ec6e3a509e25b493b20fcff8298fb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/onenorth/express-subitem/pulls/4/commits","review_comments_url":"https://api.github.com/repos/onenorth/express-subitem/pulls/4/comments","review_comment_url":"https://api.github.com/repos/onenorth/express-subitem/pulls/comments{/number}","comments_url":"https://api.github.com/repos/onenorth/express-subitem/issues/4/comments","statuses_url":"https://api.github.com/repos/onenorth/express-subitem/statuses/8987a457890a6ed5b75f09b70771483bda43dfec","head":{"label":"mrunalbrahmbhatt:master","ref":"master","sha":"8987a457890a6ed5b75f09b70771483bda43dfec","user":{"login":"mrunalbrahmbhatt","id":7857050,"avatar_url":"https://avatars.githubusercontent.com/u/7857050?v=3","gravatar_id":"","url":"https://api.github.com/users/mrunalbrahmbhatt","html_url":"https://github.com/mrunalbrahmbhatt","followers_url":"https://api.github.com/users/mrunalbrahmbhatt/followers","following_url":"https://api.github.com/users/mrunalbrahmbhatt/following{/other_user}","gists_url":"https://api.github.com/users/mrunalbrahmbhatt/gists{/gist_id}","starred_url":"https://api.github.com/users/mrunalbrahmbhatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrunalbrahmbhatt/subscriptions","organizations_url":"https://api.github.com/users/mrunalbrahmbhatt/orgs","repos_url":"https://api.github.com/users/mrunalbrahmbhatt/repos","events_url":"https://api.github.com/users/mrunalbrahmbhatt/events{/privacy}","received_events_url":"https://api.github.com/users/mrunalbrahmbhatt/received_events","type":"User","site_admin":false},"repo":{"id":69306571,"name":"express-subitem","full_name":"mrunalbrahmbhatt/express-subitem","owner":{"login":"mrunalbrahmbhatt","id":7857050,"avatar_url":"https://avatars.githubusercontent.com/u/7857050?v=3","gravatar_id":"","url":"https://api.github.com/users/mrunalbrahmbhatt","html_url":"https://github.com/mrunalbrahmbhatt","followers_url":"https://api.github.com/users/mrunalbrahmbhatt/followers","following_url":"https://api.github.com/users/mrunalbrahmbhatt/following{/other_user}","gists_url":"https://api.github.com/users/mrunalbrahmbhatt/gists{/gist_id}","starred_url":"https://api.github.com/users/mrunalbrahmbhatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrunalbrahmbhatt/subscriptions","organizations_url":"https://api.github.com/users/mrunalbrahmbhatt/orgs","repos_url":"https://api.github.com/users/mrunalbrahmbhatt/repos","events_url":"https://api.github.com/users/mrunalbrahmbhatt/events{/privacy}","received_events_url":"https://api.github.com/users/mrunalbrahmbhatt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrunalbrahmbhatt/express-subitem","description":null,"fork":true,"url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem","forks_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/forks","keys_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/teams","hooks_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/hooks","issue_events_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/issues/events{/number}","events_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/events","assignees_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/assignees{/user}","branches_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/branches{/branch}","tags_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/tags","blobs_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/statuses/{sha}","languages_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/languages","stargazers_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/stargazers","contributors_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/contributors","subscribers_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/subscribers","subscription_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/subscription","commits_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/contents/{+path}","compare_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/merges","archive_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/downloads","issues_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/issues{/number}","pulls_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/pulls{/number}","milestones_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/milestones{/number}","notifications_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/labels{/name}","releases_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/releases{/id}","deployments_url":"https://api.github.com/repos/mrunalbrahmbhatt/express-subitem/deployments","created_at":"2016-09-27T01:12:48Z","updated_at":"2016-09-27T01:12:49Z","pushed_at":"2016-09-27T01:47:34Z","git_url":"git://github.com/mrunalbrahmbhatt/express-subitem.git","ssh_url":"git@github.com:mrunalbrahmbhatt/express-subitem.git","clone_url":"https://github.com/mrunalbrahmbhatt/express-subitem.git","svn_url":"https://github.com/mrunalbrahmbhatt/express-subitem","homepage":null,"size":571,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"onenorth:master","ref":"master","sha":"0d851859153df52059105692b3c3c6f33cac2f55","user":{"login":"onenorth","id":7659942,"avatar_url":"https://avatars.githubusercontent.com/u/7659942?v=3","gravatar_id":"","url":"https://api.github.com/users/onenorth","html_url":"https://github.com/onenorth","followers_url":"https://api.github.com/users/onenorth/followers","following_url":"https://api.github.com/users/onenorth/following{/other_user}","gists_url":"https://api.github.com/users/onenorth/gists{/gist_id}","starred_url":"https://api.github.com/users/onenorth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onenorth/subscriptions","organizations_url":"https://api.github.com/users/onenorth/orgs","repos_url":"https://api.github.com/users/onenorth/repos","events_url":"https://api.github.com/users/onenorth/events{/privacy}","received_events_url":"https://api.github.com/users/onenorth/received_events","type":"Organization","site_admin":false},"repo":{"id":31904056,"name":"express-subitem","full_name":"onenorth/express-subitem","owner":{"login":"onenorth","id":7659942,"avatar_url":"https://avatars.githubusercontent.com/u/7659942?v=3","gravatar_id":"","url":"https://api.github.com/users/onenorth","html_url":"https://github.com/onenorth","followers_url":"https://api.github.com/users/onenorth/followers","following_url":"https://api.github.com/users/onenorth/following{/other_user}","gists_url":"https://api.github.com/users/onenorth/gists{/gist_id}","starred_url":"https://api.github.com/users/onenorth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onenorth/subscriptions","organizations_url":"https://api.github.com/users/onenorth/orgs","repos_url":"https://api.github.com/users/onenorth/repos","events_url":"https://api.github.com/users/onenorth/events{/privacy}","received_events_url":"https://api.github.com/users/onenorth/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/onenorth/express-subitem","description":"","fork":false,"url":"https://api.github.com/repos/onenorth/express-subitem","forks_url":"https://api.github.com/repos/onenorth/express-subitem/forks","keys_url":"https://api.github.com/repos/onenorth/express-subitem/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onenorth/express-subitem/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onenorth/express-subitem/teams","hooks_url":"https://api.github.com/repos/onenorth/express-subitem/hooks","issue_events_url":"https://api.github.com/repos/onenorth/express-subitem/issues/events{/number}","events_url":"https://api.github.com/repos/onenorth/express-subitem/events","assignees_url":"https://api.github.com/repos/onenorth/express-subitem/assignees{/user}","branches_url":"https://api.github.com/repos/onenorth/express-subitem/branches{/branch}","tags_url":"https://api.github.com/repos/onenorth/express-subitem/tags","blobs_url":"https://api.github.com/repos/onenorth/express-subitem/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onenorth/express-subitem/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onenorth/express-subitem/git/refs{/sha}","trees_url":"https://api.github.com/repos/onenorth/express-subitem/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onenorth/express-subitem/statuses/{sha}","languages_url":"https://api.github.com/repos/onenorth/express-subitem/languages","stargazers_url":"https://api.github.com/repos/onenorth/express-subitem/stargazers","contributors_url":"https://api.github.com/repos/onenorth/express-subitem/contributors","subscribers_url":"https://api.github.com/repos/onenorth/express-subitem/subscribers","subscription_url":"https://api.github.com/repos/onenorth/express-subitem/subscription","commits_url":"https://api.github.com/repos/onenorth/express-subitem/commits{/sha}","git_commits_url":"https://api.github.com/repos/onenorth/express-subitem/git/commits{/sha}","comments_url":"https://api.github.com/repos/onenorth/express-subitem/comments{/number}","issue_comment_url":"https://api.github.com/repos/onenorth/express-subitem/issues/comments{/number}","contents_url":"https://api.github.com/repos/onenorth/express-subitem/contents/{+path}","compare_url":"https://api.github.com/repos/onenorth/express-subitem/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onenorth/express-subitem/merges","archive_url":"https://api.github.com/repos/onenorth/express-subitem/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onenorth/express-subitem/downloads","issues_url":"https://api.github.com/repos/onenorth/express-subitem/issues{/number}","pulls_url":"https://api.github.com/repos/onenorth/express-subitem/pulls{/number}","milestones_url":"https://api.github.com/repos/onenorth/express-subitem/milestones{/number}","notifications_url":"https://api.github.com/repos/onenorth/express-subitem/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onenorth/express-subitem/labels{/name}","releases_url":"https://api.github.com/repos/onenorth/express-subitem/releases{/id}","deployments_url":"https://api.github.com/repos/onenorth/express-subitem/deployments","created_at":"2015-03-09T14:46:52Z","updated_at":"2016-09-26T13:40:40Z","pushed_at":"2016-09-27T02:03:52Z","git_url":"git://github.com/onenorth/express-subitem.git","ssh_url":"git@github.com:onenorth/express-subitem.git","clone_url":"https://github.com/onenorth/express-subitem.git","svn_url":"https://github.com/onenorth/express-subitem","homepage":null,"size":571,"stargazers_count":6,"watchers_count":6,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/onenorth/express-subitem/pulls/4"},"html":{"href":"https://github.com/onenorth/express-subitem/pull/4"},"issue":{"href":"https://api.github.com/repos/onenorth/express-subitem/issues/4"},"comments":{"href":"https://api.github.com/repos/onenorth/express-subitem/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/onenorth/express-subitem/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/onenorth/express-subitem/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/onenorth/express-subitem/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/onenorth/express-subitem/statuses/8987a457890a6ed5b75f09b70771483bda43dfec"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":742,"deletions":740,"changed_files":1}}
{"actor":{"display_login":"mrunalbrahmbhatt"}}