Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.
89851WIP: [TASK] Unify condition ViewHelper names
Commit message
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 9
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/51/89851/9 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/51/89851/9 && git cherry-pick FETCH_HEAD
Review
-
Code review CR 0 Needs a vote
-
Verified V 0 Needs a vote
- core-ci +1 CI
Files 9
- typo3/sysext/fluid/Classes/ViewHelpers/Be/Security/IfAuthenticatedViewHelper.php+2 −14
- typo3/sysext/fluid/Classes/ViewHelpers/Be/Security/IfHasRoleViewHelper.php+2 −14
- typo3/sysext/fluid/Classes/ViewHelpers/Be/HasRoleViewHelper.phpnew+77 −0
- typo3/sysext/fluid/Classes/ViewHelpers/Be/IsAuthenticatedViewHelper.phpnew+49 −0
- typo3/sysext/fluid/Classes/ViewHelpers/FeatureViewHelper.php+2 −14
- typo3/sysext/fluid/Classes/ViewHelpers/IsFeatureEnabledViewHelper.phpnew+54 −0
- typo3/sysext/fluid/Tests/Functional/ViewHelpers/Be/HasRoleViewHelperTest.phprenamed+16 −4
- typo3/sysext/fluid/Tests/Functional/ViewHelpers/Be/IsAuthenticatedViewHelperTest.phprenamed+17 −3
- typo3/sysext/fluid/Tests/Functional/ViewHelpers/IsFeatureEnabledViewHelperTest.phprenamed+15 −1
Review log 1221
-
Simon Praetorius uploaded patch set 1 06/24/25, 14:43
-
Simon Praetorius uploaded patch set 2 06/24/25, 14:46
-
core-ci voted on patch set 1 V -1 06/24/25, 15:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80751
-
core-ci voted on patch set 2 V -1 06/24/25, 15:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80752
-
Simon Praetorius uploaded patch set 3
V -106/24/25, 15:33 -
core-ci voted on patch set 3 V -1 06/24/25, 15:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80766
-
Simon Praetorius uploaded patch set 4
V -106/24/25, 16:35 -
core-ci voted on patch set 4 V -1 06/24/25, 16:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80777
-
Simon Praetorius uploaded patch set 5
V -106/24/25, 18:59 -
core-ci voted on patch set 5 V +1 06/24/25, 19:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80793
-
Simon Praetorius updated the commit message in patch set 6
V +106/25/25, 10:17 -
core-ci voted on patch set 6 V +1 06/25/25, 10:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80837
-
Simon Praetorius uploaded patch set 7
V +106/25/25, 19:34 -
Simon Praetorius uploaded patch set 8 06/25/25, 19:38
-
core-ci voted on patch set 7 V -1 06/25/25, 19:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80904
-
core-ci voted on patch set 8 V -1 06/25/25, 19:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80906
-
Simon Praetorius uploaded patch set 9
V -106/25/25, 19:59 -
core-ci voted on patch set 9 V +1 06/25/25, 20:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80910
-
Benjamin Franzke commented on patch set 9 07/04/25, 04:48
I think renaming offers no immediate benefit for existing users (but it makes it harder to support 3 versions, like 12, 13 & main – like many extension developers do to prefer for next-stable). Fluid changes are not compile-time detectable (or do we already have static analysis?), so why should we require users to search through all template and rewrite if they gain nothing besides an `if` or `is` prefix? I mean that's also not really a unification… I think we should revise the condition viewhelpers *at all*. The entire construct of creating dozen condition viewhelpers instead of using `<f:if>` with expressions is just a relict from a poor expression syntax that did not allow logical operators and was often broken due to escaping. So what I'd propose instead: Offer viewhelper-expressions that return bool (and are only allowed as an expression, not as a tag) so that we can unify to use `<f:if>` everywhere. Is that something that fluid could offer, expression-only viewhelpers? -
Simon Praetorius commented on patch set 9 08/04/25, 10:40
Reply
Thank your for your feedback! > Fluid changes are not compile-time detectable (or do we already have static analysis?) One feature scheduled for Fluid 5 is a cache-warmup CLI command. As a bonus, we gain the possibility to check all project templates for deprecations and parse/compile-time exceptions. I hope to be able to backport that part (probably without the warmup) to Fluid 4 and TYPO3 13, but I'm not sure yet if that will be possible. > So what I'd propose instead: Offer viewhelper-expressions that return bool (and are only allowed as an expression, not as a tag) so that we can unify to use <f:if> everywhere. If I understand that correctly, this is already somewhat possible. Fluid 4.1 brought the ability to use condition ViewHelpers without then/else, so something like this is possible today: <f:if condition="{f:be.security.ifHasRole(role: 'Administrator')}"> after renaming: <f:if condition="{f:be.hasRole(role: 'Administrator')}"> > expression-only viewhelpers? They are currently not expression-only, however I don't see that as a big issue, as it's just an alternative syntax that can make simple conditions shorter. The reasoning for renaming the existing ViewHelpers would be: * shorter, more understandable when nested in <f:if>, as demonstrated above * consistent naming, so they are more memorable and we can add more in the future (like f:extensionLoaded in a follow-up patch) What do you think? -
Simon Praetorius commented on patch set 9 08/04/25, 10:43
Reply Unresolved
Sorry, messed up the quotes there... One thing I forgot: We might also choose a longer deprecation time for the old ViewHelper names or backport the new ones to v12.