Bug #91421

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

Added by Thomas Löffler 5 months ago. Updated 11 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-05-16
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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']

Associated revisions

Revision 74e59daa (diff)
Added by Thomas Löffler 11 days ago

[TASK] Provide information about mandatory `uid` field in PHPDoc

A couple of functions in PageRepository allow to define the fields
to be selected. Because the `uid` is used internally to further
process the selected row, this field is mandatory and must be
present in a custom fields list.

This fact is now documented in all corresponding PHPDoc blocks.

Resolves: #91421
Releases: master, 10.4
Change-Id: I957da54a8fd399e375cd601e89a735821d04c3f0
Signed-off-by: Thomas Löffler <>
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64506
Tested-by: TYPO3com <>
Tested-by: Oliver Bartsch <>
Tested-by: Benni Mack <>
Reviewed-by: Oliver Bartsch <>
Reviewed-by: Benni Mack <>

Revision 20856e4d (diff)
Added by Thomas Löffler 11 days ago

[TASK] Provide information about mandatory `uid` field in PHPDoc

A couple of functions in PageRepository allow to define the fields
to be selected. Because the `uid` is used internally to further
process the selected row, this field is mandatory and must be
present in a custom fields list.

This fact is now documented in all corresponding PHPDoc blocks.

Resolves: #91421
Releases: master, 10.4
Change-Id: I957da54a8fd399e375cd601e89a735821d04c3f0
Signed-off-by: Thomas Löffler <>
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/66117
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Reviewed-by: Benni Mack <>

History

#1 Updated by Gerrit Code Review 5 months 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 https://review.typo3.org/c/Packages/TYPO3.CMS/+/64506

#2 Updated by Gerrit Code Review 5 months ago

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

#3 Updated by Gerrit Code Review 5 months ago

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

#4 Updated by Gerrit Code Review 5 months ago

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

#5 Updated by Gerrit Code Review 5 months ago

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

#6 Updated by Gerrit Code Review about 2 months ago

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

#7 Updated by Gerrit Code Review about 2 months ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64506

#8 Updated by Gerrit Code Review 11 days ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64506

#9 Updated by Gerrit Code Review 11 days ago

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66117

#10 Updated by Thomas Löffler 11 days ago

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

Also available in: Atom PDF