{"action":"opened","number":874,"pull_request":{"url":"https://api.github.com/repos/alphagov/frontend/pulls/874","id":43616198,"html_url":"https://github.com/alphagov/frontend/pull/874","diff_url":"https://github.com/alphagov/frontend/pull/874.diff","patch_url":"https://github.com/alphagov/frontend/pull/874.patch","issue_url":"https://api.github.com/repos/alphagov/frontend/issues/874","number":874,"state":"open","locked":false,"title":"Temporary workaround to fix search within a manual","user":{"login":"jennyd","id":1822424,"avatar_url":"https://avatars.githubusercontent.com/u/1822424?v=3","gravatar_id":"","url":"https://api.github.com/users/jennyd","html_url":"https://github.com/jennyd","followers_url":"https://api.github.com/users/jennyd/followers","following_url":"https://api.github.com/users/jennyd/following{/other_user}","gists_url":"https://api.github.com/users/jennyd/gists{/gist_id}","starred_url":"https://api.github.com/users/jennyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jennyd/subscriptions","organizations_url":"https://api.github.com/users/jennyd/orgs","repos_url":"https://api.github.com/users/jennyd/repos","events_url":"https://api.github.com/users/jennyd/events{/privacy}","received_events_url":"https://api.github.com/users/jennyd/received_events","type":"User","site_admin":false},"body":"We recently added the missing leading slash to the `id` and `link` fields sent\r\nto Rummager for all manuals and manual sections. At the time we thought that we\r\nshould not do the same for the `manual` field in manual sections, because it\r\nwould break searching within a manual.\r\n\r\nHowever, at the moment although the correctly scoped search results are\r\nreturned when searching within a manual, the standard search layout is used\r\nrather than the layout for scoped searches. manuals-frontend is using the\r\nmanual's path without the first character as the filter parameter [1] which\r\ncurrently matches the values in the sections' `manual` field, so the correct\r\nresults are returned. The Searcher in Frontend uses that same value (without\r\nthe leading slash) to filter on the `link` field in Rummager, and if no\r\nresults are returned (which is the case now that manuals have leading slashes\r\nin their links fields) then the search is treated as unscoped by Frontend and\r\nthe wrong presenter is used.\r\n\r\nThis commit adds the leading slash to the manual slug if it is missing when\r\nrequesting the scope object from Rummager by the link field, so that it can be\r\nfound and the correct presenter is used for scoped searches.\r\n\r\nFor consistency we should add the leading slash to the sections' `manual`\r\nfield as well; standardising on the full base path everywhere will help us\r\navoid these kinds of errors in future. The change introduced here is a\r\ntemporary workaround to use the correct layout until we've done that.\r\n\r\n[1]: https://github.com/alphagov/manuals-frontend/blob/d3b0f8ff97edaea3fb29a4c23978f44399b3f512/app/presenters/manual_presenter.rb#L17-L19\r\n\r\n/cc @rboulton ","created_at":"2015-08-28T10:56:22Z","updated_at":"2015-08-28T10:56:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/frontend/pulls/874/commits","review_comments_url":"https://api.github.com/repos/alphagov/frontend/pulls/874/comments","review_comment_url":"https://api.github.com/repos/alphagov/frontend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/frontend/issues/874/comments","statuses_url":"https://api.github.com/repos/alphagov/frontend/statuses/ef9e4dcaeaad9e919228d297fec1ce73d86f5ff2","head":{"label":"alphagov:temporary-search-within-a-manual-workaround","ref":"temporary-search-within-a-manual-workaround","sha":"ef9e4dcaeaad9e919228d297fec1ce73d86f5ff2","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":2331534,"name":"frontend","full_name":"alphagov/frontend","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/frontend","description":"Application to serve mainstream formats, the homepage, and search for the GOV.UK single domain.","fork":false,"url":"https://api.github.com/repos/alphagov/frontend","forks_url":"https://api.github.com/repos/alphagov/frontend/forks","keys_url":"https://api.github.com/repos/alphagov/frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/frontend/teams","hooks_url":"https://api.github.com/repos/alphagov/frontend/hooks","issue_events_url":"https://api.github.com/repos/alphagov/frontend/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/frontend/events","assignees_url":"https://api.github.com/repos/alphagov/frontend/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/frontend/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/frontend/tags","blobs_url":"https://api.github.com/repos/alphagov/frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/frontend/languages","stargazers_url":"https://api.github.com/repos/alphagov/frontend/stargazers","contributors_url":"https://api.github.com/repos/alphagov/frontend/contributors","subscribers_url":"https://api.github.com/repos/alphagov/frontend/subscribers","subscription_url":"https://api.github.com/repos/alphagov/frontend/subscription","commits_url":"https://api.github.com/repos/alphagov/frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/frontend/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/frontend/merges","archive_url":"https://api.github.com/repos/alphagov/frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/frontend/downloads","issues_url":"https://api.github.com/repos/alphagov/frontend/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/frontend/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/frontend/releases{/id}","created_at":"2011-09-06T00:16:08Z","updated_at":"2015-08-24T08:13:40Z","pushed_at":"2015-08-28T10:56:22Z","git_url":"git://github.com/alphagov/frontend.git","ssh_url":"git@github.com:alphagov/frontend.git","clone_url":"https://github.com/alphagov/frontend.git","svn_url":"https://github.com/alphagov/frontend","homepage":"https://www.gov.uk/","size":36800,"stargazers_count":204,"watchers_count":204,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":5,"forks":36,"open_issues":5,"watchers":204,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"36201d35de7c5e167ffb9e063aa350732cf8442e","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":2331534,"name":"frontend","full_name":"alphagov/frontend","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/frontend","description":"Application to serve mainstream formats, the homepage, and search for the GOV.UK single domain.","fork":false,"url":"https://api.github.com/repos/alphagov/frontend","forks_url":"https://api.github.com/repos/alphagov/frontend/forks","keys_url":"https://api.github.com/repos/alphagov/frontend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/frontend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/frontend/teams","hooks_url":"https://api.github.com/repos/alphagov/frontend/hooks","issue_events_url":"https://api.github.com/repos/alphagov/frontend/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/frontend/events","assignees_url":"https://api.github.com/repos/alphagov/frontend/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/frontend/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/frontend/tags","blobs_url":"https://api.github.com/repos/alphagov/frontend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/frontend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/frontend/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/frontend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/frontend/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/frontend/languages","stargazers_url":"https://api.github.com/repos/alphagov/frontend/stargazers","contributors_url":"https://api.github.com/repos/alphagov/frontend/contributors","subscribers_url":"https://api.github.com/repos/alphagov/frontend/subscribers","subscription_url":"https://api.github.com/repos/alphagov/frontend/subscription","commits_url":"https://api.github.com/repos/alphagov/frontend/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/frontend/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/frontend/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/frontend/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/frontend/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/frontend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/frontend/merges","archive_url":"https://api.github.com/repos/alphagov/frontend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/frontend/downloads","issues_url":"https://api.github.com/repos/alphagov/frontend/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/frontend/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/frontend/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/frontend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/frontend/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/frontend/releases{/id}","created_at":"2011-09-06T00:16:08Z","updated_at":"2015-08-24T08:13:40Z","pushed_at":"2015-08-28T10:56:22Z","git_url":"git://github.com/alphagov/frontend.git","ssh_url":"git@github.com:alphagov/frontend.git","clone_url":"https://github.com/alphagov/frontend.git","svn_url":"https://github.com/alphagov/frontend","homepage":"https://www.gov.uk/","size":36800,"stargazers_count":204,"watchers_count":204,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":5,"forks":36,"open_issues":5,"watchers":204,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/frontend/pulls/874"},"html":{"href":"https://github.com/alphagov/frontend/pull/874"},"issue":{"href":"https://api.github.com/repos/alphagov/frontend/issues/874"},"comments":{"href":"https://api.github.com/repos/alphagov/frontend/issues/874/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/frontend/pulls/874/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/frontend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/frontend/pulls/874/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/frontend/statuses/ef9e4dcaeaad9e919228d297fec1ce73d86f5ff2"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":6,"deletions":2,"changed_files":2}}