Bug #90356
closedoptions.pageTree.excludeDoktypes doesn't work with multiple items
0%
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
Updated by Richard Haeser about 4 years ago
I can confirm this behaviour in current master as well
Updated by Richard Haeser about 4 years 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.
Updated by Gerrit Code Review about 4 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 https://review.typo3.org/c/Packages/TYPO3.CMS/+/63239
Updated by Richard Haeser about 4 years ago
- Is duplicate of Bug #87938: Avoid superfluous cast and creation of instances DocumentTypeExclusionRestriction added
Updated by Manuel Selbach about 4 years ago
- Status changed from Under Review to Resolved
Applied in changeset c7289fa39a50782644ea28063508f7b4bba45c8c.