{"action":"closed","number":1934,"pull_request":{"url":"https://api.github.com/repos/concrete5/concrete5-legacy/pulls/1934","id":59599831,"html_url":"https://github.com/concrete5/concrete5-legacy/pull/1934","diff_url":"https://github.com/concrete5/concrete5-legacy/pull/1934.diff","patch_url":"https://github.com/concrete5/concrete5-legacy/pull/1934.patch","issue_url":"https://api.github.com/repos/concrete5/concrete5-legacy/issues/1934","number":1934,"state":"closed","locked":false,"title":"Updated Auto-Nav block controller to minimize database queries","user":{"login":"littleibex","id":13836991,"avatar_url":"https://avatars.githubusercontent.com/u/13836991?v=3","gravatar_id":"","url":"https://api.github.com/users/littleibex","html_url":"https://github.com/littleibex","followers_url":"https://api.github.com/users/littleibex/followers","following_url":"https://api.github.com/users/littleibex/following{/other_user}","gists_url":"https://api.github.com/users/littleibex/gists{/gist_id}","starred_url":"https://api.github.com/users/littleibex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/littleibex/subscriptions","organizations_url":"https://api.github.com/users/littleibex/orgs","repos_url":"https://api.github.com/users/littleibex/repos","events_url":"https://api.github.com/users/littleibex/events{/privacy}","received_events_url":"https://api.github.com/users/littleibex/received_events","type":"User","site_admin":false},"body":"The `getNavigationArray` method is responsible for populating the array of navigation items. Later, in `getNavItems` method, the controller goes through each navigation item and excludes the pages based on certain conditions. This approach is not good as it fetches all the pages and for each page separate database queries are made (i.e. for fetching page object using `Page::getByID`). Hence, there is a possibility that the menu on front end displays only 10 items, but in the back end more than 2000 queries are being made (for e.g., there is a page called Projects under Home which is set to exclude all the sub-pages from nav having 2000 pages under it of page type Project) just for that instance of Auto-Nav block.\r\n\r\nThis commit adds additional checks in the beginning of `getNavigationArray` to prevent the fetching of unnecessary pages.","created_at":"2016-02-17T05:57:44Z","updated_at":"2016-04-28T18:49:41Z","closed_at":"2016-04-28T18:49:41Z","merged_at":"2016-04-28T18:49:41Z","merge_commit_sha":"9ef8991cf4a2b053f0c1a0c53c19d51125ec0341","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/concrete5/concrete5-legacy/pulls/1934/commits","review_comments_url":"https://api.github.com/repos/concrete5/concrete5-legacy/pulls/1934/comments","review_comment_url":"https://api.github.com/repos/concrete5/concrete5-legacy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/concrete5/concrete5-legacy/issues/1934/comments","statuses_url":"https://api.github.com/repos/concrete5/concrete5-legacy/statuses/57be05b1ff67a734168c3b4cca7e412bdb38d53a","head":{"label":"littleibex:master","ref":"master","sha":"57be05b1ff67a734168c3b4cca7e412bdb38d53a","user":{"login":"littleibex","id":13836991,"avatar_url":"https://avatars.githubusercontent.com/u/13836991?v=3","gravatar_id":"","url":"https://api.github.com/users/littleibex","html_url":"https://github.com/littleibex","followers_url":"https://api.github.com/users/littleibex/followers","following_url":"https://api.github.com/users/littleibex/following{/other_user}","gists_url":"https://api.github.com/users/littleibex/gists{/gist_id}","starred_url":"https://api.github.com/users/littleibex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/littleibex/subscriptions","organizations_url":"https://api.github.com/users/littleibex/orgs","repos_url":"https://api.github.com/users/littleibex/repos","events_url":"https://api.github.com/users/littleibex/events{/privacy}","received_events_url":"https://api.github.com/users/littleibex/received_events","type":"User","site_admin":false},"repo":{"id":51840084,"name":"concrete5-legacy","full_name":"littleibex/concrete5-legacy","owner":{"login":"littleibex","id":13836991,"avatar_url":"https://avatars.githubusercontent.com/u/13836991?v=3","gravatar_id":"","url":"https://api.github.com/users/littleibex","html_url":"https://github.com/littleibex","followers_url":"https://api.github.com/users/littleibex/followers","following_url":"https://api.github.com/users/littleibex/following{/other_user}","gists_url":"https://api.github.com/users/littleibex/gists{/gist_id}","starred_url":"https://api.github.com/users/littleibex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/littleibex/subscriptions","organizations_url":"https://api.github.com/users/littleibex/orgs","repos_url":"https://api.github.com/users/littleibex/repos","events_url":"https://api.github.com/users/littleibex/events{/privacy}","received_events_url":"https://api.github.com/users/littleibex/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/littleibex/concrete5-legacy","description":"Legacy repository for concrete5","fork":true,"url":"https://api.github.com/repos/littleibex/concrete5-legacy","forks_url":"https://api.github.com/repos/littleibex/concrete5-legacy/forks","keys_url":"https://api.github.com/repos/littleibex/concrete5-legacy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/littleibex/concrete5-legacy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/littleibex/concrete5-legacy/teams","hooks_url":"https://api.github.com/repos/littleibex/concrete5-legacy/hooks","issue_events_url":"https://api.github.com/repos/littleibex/concrete5-legacy/issues/events{/number}","events_url":"https://api.github.com/repos/littleibex/concrete5-legacy/events","assignees_url":"https://api.github.com/repos/littleibex/concrete5-legacy/assignees{/user}","branches_url":"https://api.github.com/repos/littleibex/concrete5-legacy/branches{/branch}","tags_url":"https://api.github.com/repos/littleibex/concrete5-legacy/tags","blobs_url":"https://api.github.com/repos/littleibex/concrete5-legacy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/littleibex/concrete5-legacy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/littleibex/concrete5-legacy/git/refs{/sha}","trees_url":"https://api.github.com/repos/littleibex/concrete5-legacy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/littleibex/concrete5-legacy/statuses/{sha}","languages_url":"https://api.github.com/repos/littleibex/concrete5-legacy/languages","stargazers_url":"https://api.github.com/repos/littleibex/concrete5-legacy/stargazers","contributors_url":"https://api.github.com/repos/littleibex/concrete5-legacy/contributors","subscribers_url":"https://api.github.com/repos/littleibex/concrete5-legacy/subscribers","subscription_url":"https://api.github.com/repos/littleibex/concrete5-legacy/subscription","commits_url":"https://api.github.com/repos/littleibex/concrete5-legacy/commits{/sha}","git_commits_url":"https://api.github.com/repos/littleibex/concrete5-legacy/git/commits{/sha}","comments_url":"https://api.github.com/repos/littleibex/concrete5-legacy/comments{/number}","issue_comment_url":"https://api.github.com/repos/littleibex/concrete5-legacy/issues/comments{/number}","contents_url":"https://api.github.com/repos/littleibex/concrete5-legacy/contents/{+path}","compare_url":"https://api.github.com/repos/littleibex/concrete5-legacy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/littleibex/concrete5-legacy/merges","archive_url":"https://api.github.com/repos/littleibex/concrete5-legacy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/littleibex/concrete5-legacy/downloads","issues_url":"https://api.github.com/repos/littleibex/concrete5-legacy/issues{/number}","pulls_url":"https://api.github.com/repos/littleibex/concrete5-legacy/pulls{/number}","milestones_url":"https://api.github.com/repos/littleibex/concrete5-legacy/milestones{/number}","notifications_url":"https://api.github.com/repos/littleibex/concrete5-legacy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/littleibex/concrete5-legacy/labels{/name}","releases_url":"https://api.github.com/repos/littleibex/concrete5-legacy/releases{/id}","deployments_url":"https://api.github.com/repos/littleibex/concrete5-legacy/deployments","created_at":"2016-02-16T14:03:49Z","updated_at":"2016-02-16T14:03:54Z","pushed_at":"2016-02-17T05:56:30Z","git_url":"git://github.com/littleibex/concrete5-legacy.git","ssh_url":"git@github.com:littleibex/concrete5-legacy.git","clone_url":"https://github.com/littleibex/concrete5-legacy.git","svn_url":"https://github.com/littleibex/concrete5-legacy","homepage":"http://www.concrete5.org","size":39702,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"concrete5:master","ref":"master","sha":"fe37279201561c9b45db2d948bb6bc48f38b9945","user":{"login":"concrete5","id":657929,"avatar_url":"https://avatars.githubusercontent.com/u/657929?v=3","gravatar_id":"","url":"https://api.github.com/users/concrete5","html_url":"https://github.com/concrete5","followers_url":"https://api.github.com/users/concrete5/followers","following_url":"https://api.github.com/users/concrete5/following{/other_user}","gists_url":"https://api.github.com/users/concrete5/gists{/gist_id}","starred_url":"https://api.github.com/users/concrete5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concrete5/subscriptions","organizations_url":"https://api.github.com/users/concrete5/orgs","repos_url":"https://api.github.com/users/concrete5/repos","events_url":"https://api.github.com/users/concrete5/events{/privacy}","received_events_url":"https://api.github.com/users/concrete5/received_events","type":"Organization","site_admin":false},"repo":{"id":1465741,"name":"concrete5-legacy","full_name":"concrete5/concrete5-legacy","owner":{"login":"concrete5","id":657929,"avatar_url":"https://avatars.githubusercontent.com/u/657929?v=3","gravatar_id":"","url":"https://api.github.com/users/concrete5","html_url":"https://github.com/concrete5","followers_url":"https://api.github.com/users/concrete5/followers","following_url":"https://api.github.com/users/concrete5/following{/other_user}","gists_url":"https://api.github.com/users/concrete5/gists{/gist_id}","starred_url":"https://api.github.com/users/concrete5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concrete5/subscriptions","organizations_url":"https://api.github.com/users/concrete5/orgs","repos_url":"https://api.github.com/users/concrete5/repos","events_url":"https://api.github.com/users/concrete5/events{/privacy}","received_events_url":"https://api.github.com/users/concrete5/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/concrete5/concrete5-legacy","description":"Legacy repository for concrete5","fork":false,"url":"https://api.github.com/repos/concrete5/concrete5-legacy","forks_url":"https://api.github.com/repos/concrete5/concrete5-legacy/forks","keys_url":"https://api.github.com/repos/concrete5/concrete5-legacy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/concrete5/concrete5-legacy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/concrete5/concrete5-legacy/teams","hooks_url":"https://api.github.com/repos/concrete5/concrete5-legacy/hooks","issue_events_url":"https://api.github.com/repos/concrete5/concrete5-legacy/issues/events{/number}","events_url":"https://api.github.com/repos/concrete5/concrete5-legacy/events","assignees_url":"https://api.github.com/repos/concrete5/concrete5-legacy/assignees{/user}","branches_url":"https://api.github.com/repos/concrete5/concrete5-legacy/branches{/branch}","tags_url":"https://api.github.com/repos/concrete5/concrete5-legacy/tags","blobs_url":"https://api.github.com/repos/concrete5/concrete5-legacy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/concrete5/concrete5-legacy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/concrete5/concrete5-legacy/git/refs{/sha}","trees_url":"https://api.github.com/repos/concrete5/concrete5-legacy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/concrete5/concrete5-legacy/statuses/{sha}","languages_url":"https://api.github.com/repos/concrete5/concrete5-legacy/languages","stargazers_url":"https://api.github.com/repos/concrete5/concrete5-legacy/stargazers","contributors_url":"https://api.github.com/repos/concrete5/concrete5-legacy/contributors","subscribers_url":"https://api.github.com/repos/concrete5/concrete5-legacy/subscribers","subscription_url":"https://api.github.com/repos/concrete5/concrete5-legacy/subscription","commits_url":"https://api.github.com/repos/concrete5/concrete5-legacy/commits{/sha}","git_commits_url":"https://api.github.com/repos/concrete5/concrete5-legacy/git/commits{/sha}","comments_url":"https://api.github.com/repos/concrete5/concrete5-legacy/comments{/number}","issue_comment_url":"https://api.github.com/repos/concrete5/concrete5-legacy/issues/comments{/number}","contents_url":"https://api.github.com/repos/concrete5/concrete5-legacy/contents/{+path}","compare_url":"https://api.github.com/repos/concrete5/concrete5-legacy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/concrete5/concrete5-legacy/merges","archive_url":"https://api.github.com/repos/concrete5/concrete5-legacy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/concrete5/concrete5-legacy/downloads","issues_url":"https://api.github.com/repos/concrete5/concrete5-legacy/issues{/number}","pulls_url":"https://api.github.com/repos/concrete5/concrete5-legacy/pulls{/number}","milestones_url":"https://api.github.com/repos/concrete5/concrete5-legacy/milestones{/number}","notifications_url":"https://api.github.com/repos/concrete5/concrete5-legacy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/concrete5/concrete5-legacy/labels{/name}","releases_url":"https://api.github.com/repos/concrete5/concrete5-legacy/releases{/id}","deployments_url":"https://api.github.com/repos/concrete5/concrete5-legacy/deployments","created_at":"2011-03-10T22:30:30Z","updated_at":"2016-04-22T03:20:47Z","pushed_at":"2016-04-28T18:49:41Z","git_url":"git://github.com/concrete5/concrete5-legacy.git","ssh_url":"git@github.com:concrete5/concrete5-legacy.git","clone_url":"https://github.com/concrete5/concrete5-legacy.git","svn_url":"https://github.com/concrete5/concrete5-legacy","homepage":"http://www.concrete5.org","size":67053,"stargazers_count":630,"watchers_count":630,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":389,"mirror_url":null,"open_issues_count":22,"forks":389,"open_issues":22,"watchers":630,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/concrete5/concrete5-legacy/pulls/1934"},"html":{"href":"https://github.com/concrete5/concrete5-legacy/pull/1934"},"issue":{"href":"https://api.github.com/repos/concrete5/concrete5-legacy/issues/1934"},"comments":{"href":"https://api.github.com/repos/concrete5/concrete5-legacy/issues/1934/comments"},"review_comments":{"href":"https://api.github.com/repos/concrete5/concrete5-legacy/pulls/1934/comments"},"review_comment":{"href":"https://api.github.com/repos/concrete5/concrete5-legacy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/concrete5/concrete5-legacy/pulls/1934/commits"},"statuses":{"href":"https://api.github.com/repos/concrete5/concrete5-legacy/statuses/57be05b1ff67a734168c3b4cca7e412bdb38d53a"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"Remo","id":129864,"avatar_url":"https://avatars.githubusercontent.com/u/129864?v=3","gravatar_id":"","url":"https://api.github.com/users/Remo","html_url":"https://github.com/Remo","followers_url":"https://api.github.com/users/Remo/followers","following_url":"https://api.github.com/users/Remo/following{/other_user}","gists_url":"https://api.github.com/users/Remo/gists{/gist_id}","starred_url":"https://api.github.com/users/Remo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Remo/subscriptions","organizations_url":"https://api.github.com/users/Remo/orgs","repos_url":"https://api.github.com/users/Remo/repos","events_url":"https://api.github.com/users/Remo/events{/privacy}","received_events_url":"https://api.github.com/users/Remo/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":9,"deletions":0,"changed_files":1}}