Issue Bug Closed

#91421PageRepository::getMenu() without uid in field list returns broken array

Thomas Löffler 05/16/20, 23:10 updated 12/22/20, 11:08

Description

When not providing “uid” in the fields list to select, the returned array for that menu is broken.

Reproduce

1. Create a page with several subpages
2. Use PageRepository in extension code
3. Use getMenu() or any other function which uses protected function getSubpagesForPages()
4. Provide “fields” string without “uid”, e.g. only “title”

Expectation

An array with all subpages of the given page, like this:

10 => ['title' => 'Subpage 1'],
11 => ['title' => 'Subpage 2'],
12 => ['title' => 'Subpage 3']

Current result

It gives you an array with empty index and only the last page of that menu:

 => ['title' => 'Subpage 3']

Reviews 2