73589[BUGFIX] Avoid PHP 8.1 warning passing null format to DateViewHelper
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Oliver Klee +1
- Stefan Bürk +1
-
Verified V +2 Done
- Christian Kuhn +2
- Stefan Bürk +1
- core-ci +1 CI
Issues 1
Files 2
Review log 2024
-
Chris Müller uploaded patch set 1 02/17/22, 16:39
-
core-ci voted on patch set 1 V +1 02/17/22, 16:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23820
-
Stefan Bürk commented on patch set 1 02/17/22, 21:59
-
Chris Müller commented on patch set 1 02/18/22, 08:00
DateViewHelper.php:127ReplyAll view helper argument values are initialised with "null" and then iterated over the given arguments in the AbstractViewHelper. In the loop is a check if the argument is available with an isset() which returns false on null. So, no value is really set (just the default value is left untouched): https://github.com/TYPO3/Fluid/blob/master/src/Core/ViewHelper/AbstractViewHelper.php#L352 https://github.com/TYPO3/Fluid/blob/cd91278da0b1b4494158568287673bd1bb943979/src/Core/ViewHelper/AbstractViewHelper.php#L444 So, for sure, this can be changed in Fluid (to initialise the arguments with the given type) but that's possibly breaking, as this may change the behaviour of custom view helpers which rely on a null argument value. -
Stefan Bürk commented on patch set 1 02/18/22, 13:25
dannDateViewHelper.php:127ReplyIt should at least respect the default. But in this case, if argument is set with a 'null' value, the default value is not set. If argument is not provided at all, the argument is there with the default value. That's a bug. If default value is not provided (null), thaan it should register this argument with value null, which would be the same. But if a default of "''" (empty) string is declared in the registrationArgument() call, it should be expected that this is a string and at least an empty string - and not null. However, I did not said that to block this patch at all. Just to discuss this and to eloborate if a bugfix in fluid is needed or should/must be done. -
Stefan Bürk commented on patch set 1 02/18/22, 13:26
Reply
^ unintended - ignore it. -
Oliver Klee voted on patch set 1 CR +1 02/18/22, 16:30
-
Oli Bartsch commented on patch set 1 02/18/22, 17:59
DateViewHelper.php:127ReplyAs Stefan already explained, when registering an argument with some type (e.g. "string") and defining a default value with the same type, the corresponding $argument must be of this type, or depending on the input value may throw some exception. Everything else seems to be a bug in the Framework for me, because there is no point in explicitly defining the type in the registration, when in the end one still needs to manually check for the argument not being NULL (or maybe even another type). Therefore I suggest to check if it's possible to fix this in the framework. -
Christian Kuhn commented on patch set 1 02/24/22, 23:04
we *can* merge this, but it's imho an issue in fluid. if we start fixing this in core, i guess many more VH's will be affected and https://review.typo3.org/c/Packages/TYPO3.CMS/+/73588 is just one of them. -
Christian Kuhn commented on patch set 1 03/28/22, 10:25
hey. i've had a conversation with claus about this, arguing this should be fixed in fluid. he does not agree: https://notes.typo3.org/X3W0AaGaSE2eB4xou7nIVg -
Christian Kuhn commented on patch set 1 03/28/22, 13:58
DateViewHelper.php:127ReplySee https://notes.typo3.org/X3W0AaGaSE2eB4xou7nIVg - Claus insists this is not a fluid bug, so we'll pick that patch as is. -
Christian Kuhn rebased onto patch set 2 03/28/22, 13:58
-
Christian Kuhn updated the commit message in patch set 3 03/28/22, 13:59
-
Christian Kuhn voted on patch set 3 V +1 CR +1 03/28/22, 13:59
-
Stefan Bürk commented on patch set 3 V +1 CR +1 03/28/22, 14:06
DateViewHelper.php:127Replyok. -
Oliver Klee voted on patch set 3 CR +1 03/28/22, 14:08
-
core-ci voted on patch set 2 V -1 03/28/22, 14:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25212
-
core-ci voted on patch set 3 V +1 03/28/22, 14:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25213
-
Christian Kuhn uploaded patch set 4 03/28/22, 14:47
-
Oliver Klee voted on patch set 4 CR +1 03/28/22, 14:49
-
Stefan Bürk voted on patch set 4 V +1 CR +1 03/28/22, 14:56
-
core-ci voted on patch set 4 V +1 03/28/22, 15:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25218
-
Christian Kuhn voted on patch set 4 V +2 CR +2 03/28/22, 15:03
-
Christian Kuhn merged patch set 5 03/28/22, 15:03
DateViewHelper.php:127