Bug #90356

options.pageTree.excludeDoktypes doesn't work with multiple items

Added by Marieke de Bruin 14 days ago. Updated 7 days ago.

Status:
Resolved
Priority:
Should have
Category:
Pagetree
Target version:
-
Start date:
2020-02-11
Due date:
% Done:

0%

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

Description

Here https://forge.typo3.org/issues/87581 the option is reintroduced in CMS9 but it isn't working like before

When you add multiple items it's only working for the last one

How to reproduce:
- make sure you have a 254 (folder) and 199 (menu separator) page in your pagetree
- add a backend usergroup with the following TSconfig: options.pageTree.excludeDoktypes = 254,199
- add the group to the current user
- refresh the pagetree, you will see only the menu separator is not shown in the pageTree but the folder is

I think the problem is here https://github.com/TYPO3-CMS/backend/blob/master/Classes/Tree/Repository/PageTreeRepository.php#L171
There is an array with two TYPO3\CMS\Core\Database\Query\Restriction\DocumentTypeExclusionRestriction but only the last one is added because they have the same type

I use TYPO3 version 9.5.13


Related issues

Duplicates TYPO3 Core - Bug #87938: Avoid superfluous cast and creation of instances DocumentTypeExclusionRestriction Resolved 2019-03-16

History

#1 Updated by Richard Haeser 12 days ago

I can confirm this behaviour in current master as well

#2 Updated by Richard Haeser 12 days ago

  • Assignee set to Richard Haeser

It is indeed the problem that only 1 restriction of the same class can be added to QueryRestrictionContainer. In my opinion the DocumentTypeExclusionRestriction has to be changed to accept an int or an array of ints and use a notIn in the query. Will work on a patch tomorrow.

#3 Updated by Gerrit Code Review 11 days 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/+/63239

#4 Updated by Richard Haeser 11 days ago

  • Duplicates Bug #87938: Avoid superfluous cast and creation of instances DocumentTypeExclusionRestriction added

#5 Updated by Manuel Selbach 7 days ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF