Bug #102015
openIncorrect behavior of TCEFORM treeConfig.startingPoints
0%
Description
When you create a category tree by assigning the category mount to a group of non-privileged users
and at the same time using the TCEFORM treeConfig.startingPoints option, only the parent category is displayed.
In the example (of which I attach screenshots) I created a tree of categories and subcategories,
I assigned a category in the category mount point of the BE user group and in the root page of the site I
used TCEFORM.sys_category.parent.config.treeConfig.startingPoints=2581 option (where 2581 is the Uid of the "Main Root category" category).
When the non-privileged user belonging to the group tries to create a new category in the "parent" tree only "Main Root Category" appears.
If I don't use TCEFORM.sys_category.parent.config.treeConfig.startingPoints=2581 or if the user is a TYPO3 admin then TCEFORM.sys_category.parent.config.treeConfig.startingPoints=2581 works fine
Files
Updated by Robert von Hackwitz 2 months ago
- Target version changed from next-patchlevel to Candidate for patchlevel
Updated by Andreas Kienast 2 months ago
- Related to Bug #102034: The treeConfig.startingPoints parameter does not work correctly in TYPO3 v 12 (Related to https://forge.typo3.org/issues/102015) added
Updated by Robert von Hackwitz 2 months ago
Hi,
after a bit of investigation I think there is something wrong in
TYPO3\CMS\Backend\Security\CategoryPermissionsAspect around lines 70-86
foreach ($startingPoints as $startingPoint) { if (!in_array($startingPoint, $categoryMountPoints)) { $shallRepopulateTree = true; break; } $uidsInRootline = $this->findUidsInRootline($startingPoint); if (empty(array_intersect($categoryMountPoints, $uidsInRootline))) { $shallRepopulateTree = true; break; } }
With the for loop we check whether startingpoints are present in the user's categorymounts,
but the starting points can be (as in my case) subcategories of a category mount points so the if statement is false, the variable $shallRepopulateTree is set to true and the cycle is interrupted, causing the reconstruction of the tree without the categories corresponding to the starting point