Bug #92489

Calling $contentObjectRenderer->getTreeList() in eID returns empty list

Added by Xavier Perseguers 17 days ago. Updated 7 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-10-06
Due date:
% Done:

100%

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

Description

During Application's bootstrap, \TYPO3\CMS\Frontend\Http\Application::initializeContext() does that:

        GeneralUtility::makeInstance(Context::class, [
            'date' => new DateTimeAspect(new \DateTimeImmutable('@' . $GLOBALS['EXEC_TIME'])),
            'visibility' => new VisibilityAspect(),
            'workspace' => new WorkspaceAspect(0),
            'backend.user' => new UserAspect(null),
            'frontend.user' => new UserAspect(null, [0, -1]),
        ]);

this creates a default frontend.user aspect without any AbstractAuthenticationUser. As we see in the UserAspect constructor, this is totally legit and creates a stdClass object in such case:

    /**
     * @param AbstractUserAuthentication|null $user
     * @param array|null $alternativeGroups
     */
    public function __construct(AbstractUserAuthentication $user = null, array $alternativeGroups = null)
    {
        $this->user = $user ?? (object)['user' => []];
        $this->groups = $alternativeGroups;
    }

Problem is that the method ->getGroupUids() wrongly check for either a BackendUserAuthentication or a FrontendUserAuthentication for returning the associated groups, which can never occur in that context.

Due to this erroneous condition, the tree list is always empty!


Related issues

Blocks TYPO3 Core - Feature #92562: Resolve frontend user groups directly after fe_user initialization Resolved 2020-10-14

Associated revisions

Revision 6bc69695 (diff)
Added by Xavier Perseguers 7 days ago

[BUGFIX] Return alternative group uids when aspect has no user

When a UserAspect is constructed without any associated
AbstractUserAuthentication user (first constructor argument is null)
as created during Application bootstrap within
\TYPO3\CMS\Frontend\Http\Application::initializeContext(), the
alternative list of group uids needs to be made accessible. This
implies that method getGroupIds() should only check for a
BackendUserAuthentication for a special handling and not do the
erroneous check that it could alternatively be a
FrontendUserAuthentication.

Resolves: #92489
Releases: master, 10.4
Change-Id: I0342c86939fdcf03239c20fe95ae020d3d7bfc6a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/66053
Tested-by: Markus Klein <>
Tested-by: TYPO3com <>
Tested-by: Xavier Perseguers <>
Tested-by: Daniel Goerz <>
Reviewed-by: Markus Klein <>
Reviewed-by: Xavier Perseguers <>
Reviewed-by: Daniel Goerz <>

Revision ed35edfd (diff)
Added by Xavier Perseguers 6 days ago

[BUGFIX] Return alternative group uids when aspect has no user

When a UserAspect is constructed without any associated
AbstractUserAuthentication user (first constructor argument is null)
as created during Application bootstrap within
\TYPO3\CMS\Frontend\Http\Application::initializeContext(), the
alternative list of group uids needs to be made accessible. This
implies that method getGroupIds() should only check for a
BackendUserAuthentication for a special handling and not do the
erroneous check that it could alternatively be a
FrontendUserAuthentication.

Resolves: #92489
Releases: master, 10.4
Change-Id: I0342c86939fdcf03239c20fe95ae020d3d7bfc6a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/66126
Tested-by: TYPO3com <>
Tested-by: Daniel Goerz <>
Reviewed-by: Daniel Goerz <>

History

#1 Updated by Gerrit Code Review 17 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/+/66053

#2 Updated by Gerrit Code Review 17 days ago

Patch set 2 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/+/66053

#3 Updated by Gerrit Code Review 10 days ago

Patch set 3 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/+/66053

#4 Updated by Gerrit Code Review 10 days ago

Patch set 4 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/+/66053

#5 Updated by Gerrit Code Review 10 days ago

Patch set 5 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/+/66053

#6 Updated by Gerrit Code Review 8 days ago

Patch set 6 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/+/66053

#7 Updated by Markus Klein 8 days ago

  • Blocks Feature #92562: Resolve frontend user groups directly after fe_user initialization added

#8 Updated by Gerrit Code Review 7 days ago

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66126

#9 Updated by Xavier Perseguers 7 days ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF