Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Work in progress Orphaned

89851WIP: [TASK] Unify condition ViewHelper names

Simon Praetorius CR 0 V 0 Hard +234 −50 updated 08/04/25, 10:43

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

Review log 1221

  1. Simon Praetorius uploaded patch set 1 06/24/25, 14:43

  2. Simon Praetorius uploaded patch set 2 06/24/25, 14:46

  3. 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

  4. 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

  5. Simon Praetorius uploaded patch set 3 V -1 06/24/25, 15:33

  6. 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

  7. Simon Praetorius uploaded patch set 4 V -1 06/24/25, 16:35

  8. 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

  9. Simon Praetorius uploaded patch set 5 V -1 06/24/25, 18:59

  10. 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

  11. Simon Praetorius updated the commit message in patch set 6 V +1 06/25/25, 10:17

  12. 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

  13. Simon Praetorius uploaded patch set 7 V +1 06/25/25, 19:34

  14. Simon Praetorius uploaded patch set 8 06/25/25, 19:38

  15. 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

  16. 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

  17. Simon Praetorius uploaded patch set 9 V -1 06/25/25, 19:59

  18. 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

  19. 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?
  20. 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?
  21. 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.