Bug #64257

PageRepository::getMenu(): Support multiple uid

Added by Christian Weiske almost 5 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2015-01-13
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
hard
Is Regression:
No
Sprint Focus:

Description

TYPO3\CMS\Frontend\Page\PageRepository::getMenu() currently only supports an integer as $uid parameter, allowing selecting the subpages of a single parent page only.

When building a menu myself, I want to do this as efficient as possible. This means that I'd like to select the pages on the second level with a single query, instead of querying each child page for their pages.

Having getMenu() support an array of UIDs would solve the problem and make efficient selection of second level child pages possible.

Current unwanted state:

//number of SQL queries increases with the number of menu items
$childPages = $pageSelect->getMenu(0);
$subChildPages = array();
foreach ($pages as $page) {
    $subChildPages = array_merge(
        $subChildPages,
        $pageSelect->getMenu($page['uid'])
    );
}

Wanted:

// only 2 SQL queries, no matter how many child pages exist
$childPages = $pageSelect->getMenu(0);
$childUids = array_keys($childPages);
$subChildPages = $pageSelect->getMenu($childUids);


Related issues

Related to TYPO3 Core - Feature #64258: PageRepository::getPageOverlay() for multiple pages at once Closed 2015-01-13

Associated revisions

Revision dd601c5d (diff)
Added by Christian Weiske almost 5 years ago

[FEATURE] Support multiple UID in PageRepository::getMenu()

Instead of accepting only a single page ID, PageRepository::getMenu()
now also supports an array of page IDs.
This can be used to fetch the child pages of several pages with a
single SQL query.

Change-Id: I8a8b434177bf9b28a6295a746113c9519bbac997
Resolves: #64257
Releases: master
Reviewed-on: http://review.typo3.org/36042
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Mathias Schreiber almost 5 years ago

  • Target version set to 7.2 (Frontend)

#2 Updated by Mathias Schreiber almost 5 years ago

  • Complexity set to hard

#3 Updated by Gerrit Code Review almost 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36042

#4 Updated by Gerrit Code Review almost 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36042

#5 Updated by Gerrit Code Review almost 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36042

#6 Updated by Gerrit Code Review almost 5 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36042

#7 Updated by Gerrit Code Review almost 5 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36042

#8 Updated by Gerrit Code Review almost 5 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36042

#9 Updated by Christian Weiske almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#10 Updated by Riccardo De Contardi about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF