#102015Incorrect behavior of TCEFORM treeConfig.startingPoints
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
Reviews 1
Related issues 2
Files 3
History 1425
-
Robert von Hackwitz changed target version <span data-processor="relativetime" data-value="2023-09-25T08:05:20+00:00" > 09/25/23, 08:05 </span>
-
Andreas Kienast changed Related to #102034 <span data-processor="relativetime" data-value="2023-09-27T13:04:50+00:00" > 09/27/23, 13:04 </span>
-
Robert von Hackwitz commented <span data-processor="relativetime" data-value="2023-10-02T08:31:24+00:00" > 10/02/23, 08:31 </span>
-
Uwe Wiebach commented <span data-processor="relativetime" data-value="2024-06-06T09:50:22+00:00" > 06/06/24, 09:50 </span>
It’s definitely this part, because if I comment it out, the tree is built up correctly.
So I dug deeper:
If the starting point (or back then the rootUid) is a category mount point before the changes for https://forge.typo3.org/issues/95037 the tree wasn’t touched.if (in_array($dataProvider->getRootUid(), $categoryMountPoints)) { return; }Now its rootline is also checked and that’s where it all goes wrong…
I’m sure this needs more testing but in my case this worked:
foreach ($startingPoints as $startingPoint) { if (in_array($startingPoint, $categoryMountPoints)) { $shallRepopulateTree = false; break; } $uidsInRootline = $this->findUidsInRootline($startingPoint); if (!empty(array_intersect($categoryMountPoints, $uidsInRootline))) { $shallRepopulateTree = false; break; } $shallRepopulateTree = true; }Maybe this
$shallRepopulateTree = false;isn’t needed as false is the inital value.EDIT:
This only works if a starting point is set… So I changed it to:foreach ($startingPoints as $startingPoint) { if ($startingPoint) { if (in_array($startingPoint, $categoryMountPoints)) { $shallRepopulateTree = false; break; } $uidsInRootline = $this->findUidsInRootline($startingPoint); if (!empty(array_intersect($categoryMountPoints, $uidsInRootline))) { $shallRepopulateTree = false; break; } $shallRepopulateTree = true; } } -
Garvin Hicking changed Tags pagetree <span data-processor="relativetime" data-value="2024-06-06T18:31:35+00:00" > 06/06/24, 18:31 </span>
-
Uwe Wiebach commented and changed attached patch_102015.diff <span data-processor="relativetime" data-value="2024-08-30T11:36:56+00:00" > 08/30/24, 11:36 </span>
Added my changes as a patch…
-
Uwe Wiebach changed
patch_102015.diff<span data-processor="relativetime" data-value="2024-10-28T14:20:14+00:00" > 10/28/24, 14:20 </span> -
Uwe Wiebach commented and changed attached patch_102015.patch <span data-processor="relativetime" data-value="2024-10-28T14:26:36+00:00" > 10/28/24, 14:26 </span>
Unfortunately, I have only just realized that the patch file was faulty. This one should be correct…
-
Andreas Kienast commented and changed status
NewAccepted <span data-processor="relativetime" data-value="2025-01-16T13:15:12+00:00" > 01/16/25, 13:15 </span>Unfortunately, the attached patch is not sufficient. It is possible to configure multiple starting points, more than a backend user may have access to. The loop aborts after the first successful run, ignoring additional starting points, which will allow to “break out” of configured mounts.
-
Andreas Kienast changed Related to #96288 <span data-processor="relativetime" data-value="2025-01-16T13:37:38+00:00" > 01/16/25, 13:37 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 87780 status
AcceptedUnder Review <span data-processor="relativetime" data-value="2025-01-16T15:35:29+00:00" > 01/16/25, 15:35 </span> -
Gerrit Code Review pushed patch set 6 for main to change 87780 <span data-processor="relativetime" data-value="2025-01-16T15:44:58+00:00" > 01/16/25, 15:44 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 87780 <span data-processor="relativetime" data-value="2025-03-04T07:49:23+00:00" > 03/04/25, 07:49 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 87780 <span data-processor="relativetime" data-value="2025-03-04T07:53:54+00:00" > 03/04/25, 07:53 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 87780 <span data-processor="relativetime" data-value="2025-03-26T06:55:06+00:00" > 03/26/25, 06:55 </span>
-
Gerrit Code Review pushed patch set 10 for main to change 87780 <span data-processor="relativetime" data-value="2025-03-27T21:53:58+00:00" > 03/27/25, 21:53 </span>
-
Gerrit Code Review pushed patch set 11 for main to change 87780 <span data-processor="relativetime" data-value="2025-04-11T20:04:18+00:00" > 04/11/25, 20:04 </span>
-
Uwe Wiebach changed Duplicated by #106559 <span data-processor="relativetime" data-value="2025-05-28T13:07:13+00:00" > 05/28/25, 13:07 </span>
-
Gerrit Code Review pushed patch set 12 for main to change 87780 <span data-processor="relativetime" data-value="2025-07-24T12:33:30+00:00" > 07/24/25, 12:33 </span>
-
Gerrit Code Review pushed patch set 13 for main to change 87780 <span data-processor="relativetime" data-value="2025-07-29T09:29:50+00:00" > 07/29/25, 09:29 </span>
-
Gerrit Code Review pushed patch set 14 for main to change 87780 <span data-processor="relativetime" data-value="2025-07-30T11:27:10+00:00" > 07/30/25, 11:27 </span>
-
Gerrit Code Review pushed patch set 15 for main to change 87780 <span data-processor="relativetime" data-value="2026-04-22T06:53:43+00:00" > 04/22/26, 06:53 </span>
-
Andreas Kienast changed status
Under ReviewNew <span data-processor="relativetime" data-value="2026-04-22T13:43:48+00:00" > 04/22/26, 13:43 </span> -
Florian Rival commented <span data-processor="relativetime" data-value="2026-05-11T12:48:43+00:00" > 05/11/26, 12:48 </span>
The bug is still present, the current patch is abandoned, are there any plan to correct it ?
-
Benni Mack commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-11-13T08:53:27+00:00" > 11/13/26, 08:53 </span>Fixed with #106559
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