91396[BUGFIX] Ensure uri.action and link.action work the same
Commit message
Review
-
Code review CR +2 Done
- Simon Praetorius +2
- Lina Wolf +1
-
Verified V +2 Done
- Simon Praetorius +2
- Lina Wolf +1
- core-ci +1 CI
Issues 1
Files 3
Review log 2935
Show 610 earlier messages
-
Markus Klein uploaded patch set 1 10/31/25, 15:40
-
core-ci voted on patch set 1 V -1 10/31/25, 15:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88274
-
Markus Klein uploaded patch set 2
V -110/31/25, 16:03 -
Markus Klein uploaded patch set 3 10/31/25, 16:04
-
Markus Klein uploaded patch set 4 10/31/25, 16:06
-
core-ci voted on patch set 2 V -1 10/31/25, 16:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88277
-
core-ci voted on patch set 3 V +1 10/31/25, 16:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88278
-
core-ci voted on patch set 4 V +1 10/31/25, 16:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88279
-
Georg Ringer commented on patch set 4 10/31/25, 17:56
-
Markus Klein commented on patch set 4 10/31/25, 22:16
ActionViewHelper.php:93ReplyThought about this too for a long time. But what's the gain? Yet another "service" class as a bolster for 2 static functions? Functions purely related to the viewhelpers, not generic at all and actually a wrapper around typolink/uribuilder. That's why I went for the compromise to have public static functions and having those extremely similar VHs use each other. But I do not insist on that "architecture", by no means.
-
Simon Praetorius commented on patch set 4 10/31/25, 22:58
ActionViewHelper.php:93ReplyThis feels weird for me as well. To start, these methods are probably only static because it was a requirement for renderStatic(). They should probably just be normal non-static methods. So the next question is: If there's really that much glue code necessary to generate a link, how can we make sure that both instances use the same code? Several variants come to mind: * abstract class * trait * call other ViewHelper with Fluid's proper API: ViewHelperInvoker * service class I'm still not sure what's the best variant: For abstract classes, there's precedent, but it's not really meant for that. For traits there's no real precedent and there are mixed opinions about those. ViewHelperInvoker would again bind the leaf classes together. And a service class seems kind of overkill. But something else to consider: Fluid v5 (to be merged before 14.0) will add stronger type checks to ViewHelper arguments, so a lot of the casting and null-checks will probably no longer be necessary then... https://github.com/TYPO3/Fluid/commit/e36d4c2651eab8af6a6dfb265626555c4ed276d7 -
Markus Klein commented on patch set 4 11/02/25, 20:12
ActionViewHelper.php:93ReplyThanks for summarizing this Simon. That's exactly why I kept the static functions. These are "stupid" processing functions, with no state; so static is just fine in that regard. Since I'd like to have this fixed in v13 too, I really do not want to wait for Fluid v5 in this regard. Please, let's make the world better for now and not only the distant future. (v13 is still not the most used core version, so this will be the upgrade target for lots of projects) I'm happy to see this way more simplified in v14, once we got Fluid v5 under the hood. I really need this code simplification in order to be able to have 1 straight breaking change, when making pageType working how it should. Thanks. -
Simon Praetorius commented on patch set 4 11/03/25, 18:15
ActionViewHelper.php:80Can we add a comment here? Something like: > Since f:uri.action and f:link.action use exactly the same ViewHelper arguments, the glue code between the ViewHelper API and TYPO3's URI generation is shared across both ViewHelpers.ActionViewHelper.php:93Can we get rid of the `$renderChildrenClosure` as a function argument? I don't particularly like sharing that closure with internal Fluid state across ViewHelpers. In fact, I'm a bit confused what the different use cases are here. Maybe we can clarify that a bit by providing the result of `renderChildren()` to the static function instead of the closure and giving it a better name. If I understand it correctly, this is a Typolink string that will also be used as fallback (... and as tag content for link.action)? oOActionViewHelper.php:93ReplyFine by me! Let's stick to your pragmatic solution.ActionViewHelper.php:225Very strange. But we can leave it for now... -
Markus Klein commented on patch set 4 11/04/25, 09:10
ActionViewHelper.php:80ReplyWill add this.ActionViewHelper.php:93ReplySure, we can do do that. The child-content is indeed only used as fallback-text (which is not really sensible in the uri.action case) and within exceptions.ActionViewHelper.php:225Replylooks like backwards compat code. didn't touch, will not touch with this change. ;-) -
Markus Klein uploaded patch set 5
V +111/04/25, 10:15 -
Markus Klein commented on patch set 4 11/04/25, 10:15
ActionViewHelper.php:80ReplyDoneActionViewHelper.php:93ReplyDone -
Markus Klein commented on patch set 5 11/04/25, 10:16
ActionViewHelper.php:93ReplyDone -
core-ci voted on patch set 5 V +1 11/04/25, 10:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88449
-
Simon Praetorius voted on patch set 5 CR +1 V +1 11/04/25, 11:25
-
Lina Wolf commented on patch set 5 CR +1 V +1 11/04/25, 12:52
Testet with the t3docs/example extensions non Extbase Haiku plugin and the t3doc/blog-example extensions Extbase plugin. I am all for a pragmatic solution here. -
Simon Praetorius voted on patch set 5 CR +2 V +2 11/04/25, 17:25
-
Ayke Halder commented on patch set 5 CR -1 11/04/25, 17:50
Please check limits of `$arguments['pageUid']` and `$arguments['pageType']`ActionViewHelper.php:194This allows for `$pageUid` to be `0` or negative. The old code only called `UriBuilder::getTargetPageUid($pageUid)` in case `$pageUid > 0`. ```suggestion $pageUid = max(0, (int)($arguments["pageUid"] ?? 0)) ?: null); ```ActionViewHelper.php:195This allows for `$pageType` to be `0` or negative. The old code only called `UriBuilder::setTargetPageType($pageType)` in case `$pageType > 0`. As `UriBuilder::pageType` defaults to `0`, this can also be called with `0`. ```suggestion $pageType = max(0, (int)$arguments['pageType']); ```ActionViewHelper.php:235Is there a reason `TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setTargetPageUid(int $targetPageUid)` does not accept `null`? We might change that there and remove the `if`-clause here. `UriBuilder::getTargetPageUid(): ?int` already allows return value of `null` as `$this->targetPageUid` is initialised with `null` anyway.ActionViewHelper.php:240`setTargetPageType` is already called above - without any check. -
Ayke Halder commented on patch set 5 11/04/25, 18:03
ActionViewHelper.php:195ReplyAnd suppress `PHP Notice: Undefined index: pageType`: ```suggestion $pageType = max(0, (int)($arguments['pageType'] ?? 0)); ``` -
Simon Praetorius commented on patch set 5 11/04/25, 18:17
(waiting on backport conflicts to be resolved)ActionViewHelper.php:195ReplyI think this line will be touched in a follow-up anyways, but I'll let Markus respond here. -
Markus Klein commented on patch set 5 V -1 11/04/25, 18:18
ActionViewHelper.php:195ReplypageType has a default value defined in its registration, hence this can't happen.ActionViewHelper.php:235ReplySee https://forge.typo3.org/issues/107347 for this. This is the upcoming breaking change for v14 I'm about to prepare. This patch only does the pre-work to cleanup things.ActionViewHelper.php:240ReplyThis is indeed a mistake, the call above is wrong! -
Simon Praetorius voted on patch set 5 CR +1 V +1 11/04/25, 18:19
-
Markus Klein commented on patch set 5 11/04/25, 18:22
ActionViewHelper.php:194ReplyIt did in this class, but not in the other! The sole reason to get this right, now, finally. Moreover, the direct call to the setter is wrong and removed in the next patch-setActionViewHelper.php:240ReplyDone -
Markus Klein uploaded patch set 6
CR +1V +111/04/25, 18:22 -
core-ci voted on patch set 6 V +1 11/04/25, 18:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/88475
-
Markus Klein commented on patch set 6 11/04/25, 18:46
Reply
DoneActionViewHelper.php:235ReplyDone -
Lina Wolf voted on patch set 6 CR +1 V +1 11/04/25, 19:37
-
Markus Klein commented on patch set 6 11/04/25, 20:27
ActionViewHelper.php:195ReplyDone -
Simon Praetorius voted on patch set 6 CR +2 V +2 11/05/25, 08:40
-
Simon Praetorius merged patch set 7 11/05/25, 08:40
-
Markus Klein commented on patch set 7 11/18/25, 10:13
Regression fix: https://review.typo3.org/c/Packages/TYPO3.CMS/+/91712
ActionViewHelper.php:93