Issue Bug New Orphaned

#102034The treeConfig.startingPoints parameter does not work correctly in TYPO3 v 12 (Related to https://forge.typo3.org/issues/102015)

Robert von Hackwitz 09/25/23, 13:51 updated 04/22/26, 13:43

Description

Scenario:
1) A fresh TYPO3 v 12 installation
2) A page tree with 2 website root pages and a sysfolder (as in screenshot “Page_Tree.png”)
3) A Category Tree in the sysfolder (as in screenshot “Category_Tree.png”)
4) A backend usergroup named “Website A & B usergroup” that can manage both sites and has “Main Category 1” in Category Mounts (as in screenshot “Backend_Group.png”)
5) On “Website A” page -> Resources this TSConfig: TCEFORM.sys_category.parent.config.treeConfig.startingPoints=3 (where “3” is the uid of the first subcategory of “Main Category 1”

if the backend user associated with the backend usergroup tries to create a new category on the “Website A” page he should be able to see in the “parent” field the sub-category “Sub Category Root for Website A” and its subcategories thanks to the parameter TCEFORM.sys_category.parent.config.treeConfig.startingPoints=3 Instead he just sees only “Sub Category Root for Website A” (as in screenshot “New_Category_Creation.png”.

This is related to bug [102015]

Reviews 1

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". The changes above were merged or abandoned: read them before you start. How to create a patch

Commit message
[BUGFIX] The treeConfig.startingPoints parameter does not work correctly in TYPO3 v 12 (Related to https://forge.typo3.org/issues/102015) Resolves: #102034 Releases: main

Files 4

History 415

  1. Robert von Hackwitz commented <span data-processor="relativetime" data-value="2023-10-02T08:38:01+00:00" > 10/02/23, 08:38 </span>

    Hi,
    after a bit of investigation I think there is something wrong in
    TYPO3\CMS\Backend\Security\CategoryPermissionsAspect around lines 68-80

                   foreach ($dataProvider->getStartingPoints() 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