Bug #86229

Symfony expressions/conditions doesn't work in user-tsconfig

Added by Wittkiel Gruppe over 1 year ago. Updated 16 days ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
TypoScript
Target version:
Start date:
2018-09-11
Due date:
% Done:

100%

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

Description

Because of deprecations we want to switch from this working solution

[adminUser = 1]
options.pageTree.showPageIdWithTitle = 1
[END]

to this new condition

[backend.user.isAdmin]
options.pageTree.showPageIdWithTitle = 1
[END]

But in user-tsconfig the new expressions/conditions doesn't work, no error for that problem in logs.

TYPO3 9.4.0 (non-composer)
PHP 7.2


Related issues

Related to TYPO3 Core - Bug #86856: Workspace Context API is set wrong in BE Closed 2018-11-05
Related to TYPO3 Core - Bug #86923: Symfony expressions/conditions doesn't work in user-tsconfig Resolved 2018-11-14
Related to TYPO3 Core - Bug #88841: Conditions in .tsconfig file are not read Needs Feedback 2019-07-25
Related to TYPO3 Core - Bug #90075: backend user symfony expressions not working in TSConfig Resolved 2020-01-09

Associated revisions

Revision 52c391df (diff)
Added by Frank Naegler over 1 year ago

[BUGFIX] Set BackendUserAspect earlier to make it usable in TSConfig

This patch fix broken TSConfig condition because of missing backend user aspect.

Resolves: #86229
Releases: master
Change-Id: I6528b5d48a5b5711cad8710d4bfcc6222f9fef9c
Reviewed-on: https://review.typo3.org/58275
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>
Tested-by: TYPO3com <>
Reviewed-by: Andreas Fernandez <>
Tested-by: Andreas Fernandez <>

Revision b315587d (diff)
Added by Oliver Hader about 1 year ago

Revert "[BUGFIX] Set BackendUserAspect earlier to make it usable in TSConfig"

This reverts commit 52c391df3d4070d7bb192c724597141111e70b21.

When a backend user has set a workspace, this needs
to happen AFTER the user has been initialized (and
the proper workspace has been set), otherwise all
workspace queries are nailed down to "wsid=-99".

Resolves: #86856
Related: #86229
Releases: master
Change-Id: Iee804f99639e1957421818f7ed2bff134b269244
Reviewed-on: https://review.typo3.org/58845
Tested-by: TYPO3com <>
Reviewed-by: Andreas Fernandez <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Andreas Wolf <>
Tested-by: Andreas Wolf <>

Revision 7ffd8cb0 (diff)
Added by Benni Mack 8 days ago

[BUGFIX] Re-enable conditions within UserTSconfig

The backend user aspect must be set before BE_USER->fetchGroups is called
and the TypoScript parser needs a proper ConditionMatcher object for the Symfony-based UserTSconfig conditions like [backend.user.isAdmin] to be
working.

Note to future self:
The reason why the original change was reverted was that:
- before workspace-related conditions did not work.
- then workspaces worked, but conditions in userTSconfig bricked partially
- the patch was reverted and left for dead for 1 year as it's a chicken-egg problem

The main issue is that fetchGroup() is doing too much.
- A valid user record exists, but the right workspace haven't been "set" which
always returns workspace=0 for workspace-related conditions
- So the workspace must be initialized earlier, and not at the end of the fetchGroups()
call.
- workspaceInit() - and some other code within fetchGroups() relies on finished TSconfig (that is the actual chicken-egg problem)

So we'll just set the aspects before, but BEFORE setting the aspects,
we'll evaluate the selected workspace of a user in a "plain" way.

The reason why the backend context aspect now works (again) is because the
context contains a "real" BE user object and fetches the data from the object,
where as the workspace aspect just contains a static property.

Resolves: #90075
Resolves: #86923
Related: #86229
Reverts: #86856
Releases: master, 9.5
Change-Id: I326d92a860a806ff13748cf13ef6b71b7a77089e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62887
Reviewed-by: Susanne Moog <>
Reviewed-by: Henning Liebe <>
Reviewed-by: Sascha Rademacher <>
Reviewed-by: Frank Nägler <>
Reviewed-by: Felix P. <>
Reviewed-by: Benni Mack <>
Tested-by: Susanne Moog <>
Tested-by: TYPO3com <>
Tested-by: Frank Nägler <>
Tested-by: Benni Mack <>

History

#1 Updated by Frank Naegler over 1 year ago

  • Assignee set to Frank Naegler
  • PHP Version set to 7.2

#2 Updated by Gerrit Code Review over 1 year 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/58275

#3 Updated by Gerrit Code Review over 1 year 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/58275

#4 Updated by Frank Naegler over 1 year ago

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

#5 Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed

#6 Updated by Benni Mack about 1 year ago

  • Related to Bug #86856: Workspace Context API is set wrong in BE added

#7 Updated by Oliver Hader about 1 year ago

  • Related to Bug #86923: Symfony expressions/conditions doesn't work in user-tsconfig added

#8 Updated by Jonas Eberle 6 months ago

  • Related to Bug #88841: Conditions in .tsconfig file are not read added

#9 Updated by Ingo Fabbri 16 days ago

#10 Updated by Ingo Fabbri 16 days ago

  • Related to Bug #90075: backend user symfony expressions not working in TSConfig added

Also available in: Atom PDF