Review main Merged

90424[BUGFIX] Remove defaults from required ViewHelper arguments

Simon Praetorius CR +2 V +2 Easy +43 −3 updated 08/17/25, 13:15

Commit message

ViewHelper arguments can either be optional, in which case a
default value can be defined, or they can be required, then
without a default.

This patch adjusts two ViewHelpers where arguments have
been defined as required with a default value. This change
doesn't have any effect on the behavior of the ViewHelpers,
as the requirement is always checked by Fluid, even if a
default value is specified (which is ignored in that case).
With Fluid 5, this misconfiguration will lead to a proper
exception.

Review

  • Code review CR +2 Done
    • Simon Praetorius +2
    • Oli Bartsch +1
    • Oliver Klee +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Simon Praetorius +2
    • Oli Bartsch +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 1216

  1. Simon Praetorius uploaded patch set 1 08/16/25, 15:36

  2. core-ci voted on patch set 1 V +1 08/16/25, 15:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83504

  3. Oliver Klee voted on patch set 1 CR +1 08/16/25, 16:04

  4. Stefan Bürk commented on patch set 1 08/16/25, 22:13

    TBH not tested ... what was/is the effect of a required argument with a default. Did it acted as "optional" when not provided ? Or was it just confusing that the default value had to be provided ? In case it acts as optional, this is kind of breaking, what bugfixes are generally if someone takes it as a feature .. in case of the FineDiffViewHelper it may okay as it is internal and I guess mostly used by TYPO3 only. DataPickerViewHelper may be more eligable to be reused. Not getting the "real" issue from commit message, what is written only shows that it does not make much sense to mix it. Or does it throw an exception ?

    DatePickerViewHelper.php:61

    ```suggestion $this->registerArgument('previewMode', 'bool', 'Preview mode flag', true); ``` As we are already changing this argument registration, we can fix the typo along the way. What do you think ?
  5. Simon Praetorius uploaded patch set 2 CR +1 V +1 08/16/25, 23:02

  6. Simon Praetorius uploaded patch set 3 08/16/25, 23:02

  7. core-ci voted on patch set 3 V -1 08/16/25, 23:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83509

  8. core-ci voted on patch set 2 V -1 08/16/25, 23:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83508

  9. Simon Praetorius uploaded patch set 4 V -1 08/16/25, 23:20

  10. Simon Praetorius commented on patch set 3 08/16/25, 23:21

    Reply

    The behavior of the ViewHelper doesn't actually change with this patch. However, Fluid v5 will throw an exception because it's a misconfiguration. I've adjusted the commit message to explain this a bit further. I've also added a test case to verify this. Patchset 2 contains only the new test case, Patchset 3 also contains the changes in the ViewHelper, both are green (I messed up the test namespace though, which is why overall CI was red...).

    DatePickerViewHelper.php:61 Reply

    Done
  11. core-ci voted on patch set 4 V +1 08/16/25, 23:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83510

  12. Simon Schaufelberger voted on patch set 4 CR +1 V +1 08/17/25, 06:13

  13. Oliver Klee voted on patch set 4 CR +1 08/17/25, 07:48

  14. Oli Bartsch voted on patch set 4 CR +1 V +1 08/17/25, 08:07

  15. Simon Praetorius commented on patch set 4 CR +2 V +2 08/17/25, 13:14

    Reply

    Done
  16. Simon Praetorius merged patch set 5 08/17/25, 13:15