Bug #90075

backend user symfony expressions not working in TSConfig

Added by Ingo Fabbri 10 months ago. Updated 2 months ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-01-09
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:
On Location Sprint

Description

Symfony expressions regarding "backend.user" do not work in tsconfig.

legacy conditions work

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

symfony expressions do not work

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

This was already fixed - but caused a regression.


Related issues

Related to TYPO3 Core - Bug #86229: Symfony expressions/conditions doesn't work in user-tsconfig Closed 2018-09-11
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 Closed 2018-11-14
Related to TYPO3 Core - Bug #92516: Symfony expressions/conditions doesn't work in user-tsconfig in context menu New 2020-10-08

Associated revisions

Revision 7ffd8cb0 (diff)
Added by Benni Mack 9 months 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 Ingo Fabbri 10 months ago

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

#2 Updated by Ingo Fabbri 10 months ago

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

#3 Updated by Riccardo De Contardi 10 months ago

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

#4 Updated by Susanne Moog 10 months ago

  • Sprint Focus set to On Location Sprint

#5 Updated by Gerrit Code Review 10 months 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/+/62887

#6 Updated by Gerrit Code Review 10 months 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/+/62887

#7 Updated by Gerrit Code Review 10 months 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/+/62887

#8 Updated by Benni Mack 9 months ago

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

#9 Updated by Benni Mack 8 months ago

  • Status changed from Resolved to Closed

#10 Updated by Gerrit Code Review 7 months ago

  • Status changed from Closed to Under Review

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

#11 Updated by Frank Naegler 6 months ago

  • Status changed from Under Review to Accepted

already fixed in master (v10)

#12 Updated by Stefan P 4 months ago

"Releases: master, 9.5" is said in the box on the right. This is wrong. Will this be in v9 or not? We heavily depend on this condition... What is a workaround?

Does "LTS" mean anything these days?

#13 Updated by Benni Mack 3 months ago

  • Status changed from Accepted to Needs Feedback

Hey Stefan,

Stefan P wrote:

"Releases: master, 9.5" is said in the box on the right. This is wrong. Will this be in v9 or not? We heavily depend on this condition... What is a workaround?

The provided solution I built did not work out for v9.5, as there were like 10 times more factors counted in to ensure this works (legacy code is still taken into account). To be honest, I fixed this issue and it took me 4 nights to make this work again with TYPO3 v10, and adding this to TYPO3 v9 will cost me at least the same amount again.

I really appreciate to see that you need this functionality, however there are more than 2000 open issues, and if you can point me to the direction where I find more people doing this work for free, let me know. You can also check at the TYPO3 GmbH if they are willing to fix this bug.

Does "LTS" mean anything these days?

Can you elaborate on this? LTS = "Long Term Support".

In the meantime: I'd say the workaround is to use the previous condition syntax (as in v8) for v9, and disabling the deprecation log in production.

#14 Updated by Stefan P 2 months ago

Benni Mack wrote:

Does "LTS" mean anything these days?

Can you elaborate on this? LTS = "Long Term Support".

? Yes, Looooong Term Support.

I can only repeat what I already wrote in another ticket:

v9 is still LTS and marketed as an "enterprise CMS". Most big setups (the ones that are affected by such behaviour most) are starting just now to migrate now from 8 to 9 - hundreds-of-domain setups with loads of stakeholders and budgets of several 100k can't simply "early-adopt" or "upgrade to next version". The release schedule and time span for giving this kind of feedback for real-life setups (with a chance of fixing/implementing) of TYPO3 got way to tight lateley...

v9 is the version where we had to implement - by far - the most workaround/custom patches/hooks/xclasses after the upgrade form teh previous version. It's the version where we opened - by far - the most forge issues. And all we get replied is always "nah, only in 10" (or sometimes even "only in 11 if at all"). That's just frustrating.

doing this work for free

No, just no. People/companies are paying fees for the certificates. People/companies pay membership fees. People/companies donate (money, code, extensions or time). People do debugging and create forge issues in time for which they get paid by their own companies and should actually work for their own customers. Companies using TYPO3 for their customers spread the word about TYPO3 this way. That is totally not "for free". They trusted on terms like "*Long* Term Support" and "*Enterprise* CMS" when they decided to choose TYPO3 in the first place.

#15 Updated by Ingo Fabbri 2 months ago

Benni Mack wrote:

I really appreciate to see that you need this functionality, however there are more than 2000 open issues, and if you can point me to the direction where I find more people doing this work for free, let me know. You can also check at the TYPO3 GmbH if they are willing to fix this bug.

I guess "Stefan P" is so upset, because of the claim, TYPO3 beeing an enterprise CMS:

We all know (first-hand or from stories), that proprietary enterprise-software isn't better in terms of "less bugs" or "more stable".

For me "TYPO3 Enterprise" does not mean, that anyone has to fix ALL BUGS ASAP. For me it means just: take reported bugs seriously. Stale issues from 10 years ago with serious bug-reports do not deserve to be closed after 10 years with the comment: "sorry, did not hear from you. stale issue. close". That's part of the story, how it was possible to "resolve" so many issues before the v10 release...

Enterprise in general should mean: focus on fixing bugs that are production-relevant first. nice-to-have features second.
Nobody needs to do that for free of course - but then TYPO3 needs to rethink the "ENTERPRISE" claim.
Noone would complain and insist on fixing bugs, when it would say: "TYPO3 - a pure community CMS". Then it is fine, that you either have to fix it yourself or wait for someone doing it for free. But telling the whole world: "TYPO3 - we are the ENTERPRISE CMS" just makes people think/assume, that any bug that is reported, MUST be fixed ASAP. Just because it is ENTERPRISE.

Back to topic:

For me as reported it is fine, to have the feature working in v10 and still using the deprecated syntax in v9 - as deprecations are not logged in production systems.

#16 Updated by Stefan P 2 months ago

I'm not taking about "fix ASAP". Nobody can expect that. I'm talking about "fix them at all and care for the product". This very ticket here was reported in a time when v9 still was even in the regular schedule.

I have the feeling the "rapid release plan" with having two LTS versions and one dev-version simultaniously (9, 10 and 11) just does this: dev is "developed" (actually meaning "replaced by Symfony"), newer LTS gets critical bug fixes, older (but still claimed to be supoorted!) LTS is de-facto-abandoned.

But real enterprises (the ones with a lot of money, stakeholders, domains, features, huge code bases) must always to some agree be more conservative. They migrate always to the "older" (but claimed to be still supported!) LTS, because they need time and stability (9.5.0 was highly unstable for such big projects, they can't "just upgrade" rigth away, even if the client gave it's go from a budget POV - the upgarde of the custom code itself needs some month on its own in some cases anyways).

But exactly these big enterprises are the ones that rely most on these "rarely-used" core features (these features exactly meant for such big conservative enterprises).

#17 Updated by Benni Mack 2 months ago

v9 is still LTS and marketed as an "enterprise CMS". Most big setups (the ones that are affected by such behaviour most) are starting just now to migrate now from 8 to 9 - hundreds-of-domain setups with loads of stakeholders and budgets of several 100k can't simply "early-adopt" or "upgrade to next version". The release schedule and time span for giving this kind of feedback for real-life setups (with a chance of fixing/implementing) of TYPO3 got way to tight lateley...

Yes. We've learned from our mistakes we did in TYPO3 v9, and try to avoid making the same mistakes in v10 and v11 anymore.

v9 is the version where we had to implement - by far - the most workaround/custom patches/hooks/xclasses after the upgrade form teh previous version. It's the version where we opened - by far - the most forge issues. And all we get replied is always "nah, only in 10" (or sometimes even "only in 11 if at all"). That's just frustrating.

I can relate to that, and see that this is frustrating for you.

doing this work for free

No, just no. People/companies are paying fees for the certificates. People/companies pay membership fees. People/companies donate (money, code, extensions or time). People do debugging and create forge issues in time for which they get paid by their own companies and should actually work for their own customers. Companies using TYPO3 for their customers spread the word about TYPO3 this way. That is totally not "for free". They trusted on terms like "*Long* Term Support" and "*Enterprise* CMS" when they decided to choose TYPO3 in the first place.

Exactly. I donate my money, code, extensions and time, so others don't have to pay for the license fees. Read also about my commitment on fixing TYPO3 Core bugs even more seriously here https://b13.com/blog/investing-in-typo3-core-development

And instead of closing tickets I (personally) DO care about fixing as many bugs as possible, and we care about the issues your report on forge. Some of your other issues have been triaged already in the meantime - also feel free to reach out to me directly via Email, Phone or Slack to see if we can find a way to prioritize your pain points and make sure to have a "Enterprise"-worthy product which also keeps it promises on LTS in the future. I take your raised concerns seriously!

#18 Updated by Dmitry Dulepov 20 days ago

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

Also available in: Atom PDF