80037[TASK] Allow f:link.action and f:uri.action without Extbase
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Benjamin Franzke +1
- Benni Mack +1
-
Verified V +2 Done
- Stefan Bürk +2
- Benjamin Franzke +1
- Oliver Klee +1
- Benni Mack +1
- core-ci +1 CI
Issues 3
Files 4
- typo3/sysext/fluid/Classes/ViewHelpers/Link/ActionViewHelper.php8+121 −7
- typo3/sysext/fluid/Classes/ViewHelpers/Uri/ActionViewHelper.php+122 −7
- typo3/sysext/fluid/Tests/Functional/ViewHelpers/Link/ActionViewHelperTest.phpnew+232 −0
- typo3/sysext/fluid/Tests/Functional/ViewHelpers/Uri/ActionViewHelperTest.phpnew+228 −0
Review log 2537
Show 612 earlier messages
-
Stefan Bürk uploaded patch set 1 07/15/23, 10:40
-
core-ci voted on patch set 1 V -1 07/15/23, 10:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44167
-
Stefan Bürk uploaded patch set 2
V -107/15/23, 12:55 -
Stefan Bürk updated the commit message in patch set 3 07/15/23, 12:56
-
core-ci voted on patch set 3 V -1 07/15/23, 13:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44173
-
core-ci voted on patch set 2 V -1 07/15/23, 13:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44172
-
Stefan Bürk uploaded patch set 4
V -107/26/23, 10:00 -
core-ci voted on patch set 4 V -1 07/26/23, 10:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44571
-
Stefan Bürk uploaded patch set 5
V -107/26/23, 11:33 -
core-ci voted on patch set 5 V +1 07/26/23, 11:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44578
-
Stefan Bürk updated the commit message in patch set 6
V +107/26/23, 12:33 -
core-ci voted on patch set 6 V +1 07/26/23, 12:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44580
-
Alexander Schnitzler commented on patch set 6 07/26/23, 19:08
Phew, all this reminds me of my troubles with the attempt to reimplement the UriBuilder, implement dedicated UriBuilders for frontend and backend and quite indepedendently of the Extbase context: https://review.typo3.org/c/Packages/TYPO3.CMS/+/66322 Let me be frank: I think this current patch might present a working solution but it pulls too much service logic into view helpers. Also, I rather dislike if code has to actively decide what context it runs in rather than relying on interfaces that tell services what they can do with objects. This is super vague, I get that. Example: Instead of checking if I have an extbase request object present, which then tells me what context I am in, I (as an uri builder) would like to receive instructions that tell me how to build uris. Those have to be built based on context specific information of course. At some point we need to evaluate the context (context as in core/extbase, not as in frontend/backend). The viewhepers would still need to evaluate the context but instead of implementing all logic for different contexts here, we should create uri building instructions for a context agnostic uri building service and call that instead. What specific implementation we are using in the background (typolink vs. core uri builder) is less important to me. But seeing that you strive for a backportable solution... Not really easy. -
Stefan Bürk commented on patch set 6 07/26/23, 20:47
Reply
This is a first quick try to get a intermediate solution, which makes the life of users a little easier - and calm down the public shitstorm currently rising up. Not as a final solution. Basically, we do not need change the `*.action` ViewHelper - if we continue to force developer and integrators to switch to the `*.typolink` or the `*.page` ViewHelper directly in non-extbase context. Basically, this change does the same change which have been done in the *.page ViewHelper. (And therefore a code duplication for now - because I copy&pasted it from there with some adjustments as a test/poc and to see what may be needed). Using the *.page or *.typolink ViewHelper is not really considered as a solution by many people out there. So we need to find and provide a backportable solution without much hassle and introducing code or things we have to live longer again because we cannot get rid of it directly again. You are right about code duplication. At least the *.page/*.action counterparts in uri OR link shares the same code. In some cases the "children-content" needs to be rendered - so this would be needed to provided as callback or pre-build before calling a service - not sounding better at all. Some of the 2 mentioned ViewHelper uses renderStatic(), the other two uses `render()`. This change targets to bring a nearby solution - possible to backport to v12 - where people have the pain now and which is growing bigger and bigger from day to day. On the otherhand, it's only a "part" of multiple issues related to the same topic. We still have the `form.*` ViewHelpers, which are gonna get really tricky to solve between extbase bound and not extbase bound context. Not looked into them yet, but that would be one of my/the next steps - even before continuing on this one. I already wrote with Benjamin Franzke about this and came up with the idea of a internally service to tackle the current code duplication as a solution helper. First quick shot was to use traits, but currently we would need 2 of them for each context type. Not knowing how this would envolve for other places. We need to check and evaluate the form* ViewHelpers next to have more argument points for a solution service or not. This is not a final or a final-intermediate solution, only a early quick&dirty wip/poc and already considered to (slightly) change after we have other related points on the table. Not picking up some points for now or adding more not directly relevant topics to find a "intermediate fix" solution. We need to come up with a working solution for v12 - and than clean it up well-thought in v13+. For v13+ we **should** - no we **must** - make a concept what to do or not to do and how to work towards it, which includes a lot of topics and decisions and parts. I'm mainly with you, but still I think we should avoid a quick shot and big build with "flaws" introducing even more headache in v13+ and cleanup to do. Not sure what the "final" proposal would be - but it may be something we all not "really" like if we would build it new for v13+ only and with time to make it right - at least reducing the pain for users(developers/integrators) in the v12 LTS version. -
Stefan Bürk updated the commit message in patch set 7
V +107/27/23, 11:13 -
core-ci voted on patch set 7 V +1 07/27/23, 11:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44613
-
Stefan Bürk uploaded patch set 8
V +108/22/23, 11:58 -
core-ci voted on patch set 8 V -1 08/22/23, 12:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45672
-
Stefan Bürk uploaded patch set 9
V -108/22/23, 12:36 -
Stefan Bürk commented on patch set 9 08/22/23, 12:36
Reply
Done -
Stefan Bürk updated the commit message in patch set 10 08/22/23, 12:37
-
core-ci voted on patch set 9 V +1 08/22/23, 12:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45676
-
core-ci voted on patch set 10 V +1 08/22/23, 12:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45677
-
Stefan Bürk updated the commit message in patch set 11
V +108/22/23, 12:48 -
core-ci voted on patch set 11 V +1 08/22/23, 12:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45678
-
Benjamin Franzke commented on patch set 11 08/23/23, 12:15
Reply
My position on this is: UriBuilder should be refactored to be usable without extbase context (which would be an optional variable to the API methods) in v13 and then all these viewhelpers can use a proper API. Until then this is a good purposive solution to fix the situation we have.ActionViewHelper.php:148I don't think that would be wise. It works in v11, yes, but it does always produce *wrong* arguments in v11, when that is done. It is fine to keep the exception in v12 in that case (as that's not a new breaking thing) So let's drop this @todo with no further changes needed.ActionViewHelper.php:158No, grepped the source. See also following non-extbase-content class which does the calculation on it's own as well: typo3/sysext/extbase/Classes/Routing/ExtbasePluginEnhancer.php (that uses a ucwords in an intermediate value, but that's actually not needed) @todo can be dropped. -
Christian Kuhn commented on patch set 11 08/23/23, 13:20
Reply
Yes. That's the idea and the reason we create some mitigation now: extbase uribuilder reduced dependencies a lot in v13 already, especially direct deps to ConfigurationManager is gone, and this BE argument namespacing is gone as well. Next step would be to avoid extbase Uribuilder in BE context using the existing BE route VH's instead, which would make extbase UriBuilder FE-only and will reduce deps to request. After that, we can see what is left and see if we could create a new frontend related uri generation class from it somehow. And then, these VH's don't have this extbase dependency anymore ... That's the rough idea, we'll see how it works out. -
Benjamin Franzke uploaded patch set 12
V +109/05/23, 22:11 -
Benjamin Franzke commented on patch set 12 09/05/23, 22:11
ActionViewHelper.php:148ReplyDropped that todo.ActionViewHelper.php:158ReplyDoneActionViewHelper.php:212I looked into how one backend module can (currently) link to another one: ``` <f:link.action action="statistic" arguments="{route: 'web_IndexedSearchIsearch'}" additionalParams="{id: 770}" extensionName="IndexedSearch" pluginName="web_IndexedSearchIsearch" controller="Administration">Test link</f:link.action> ``` It *needs* to set a `route` argument, otherwise the current one is taken. The current backend-generation code in this class is unfortunately buggy, as the plugin signature needs to be calculated differently (needs to be resolved into pseudo route-names) I think the main issue we need to fix is Frontend and would propose to leave backend links from non-extbase context to extbase unsupported. Do you agree? I hope so, as I've now decided to remove this code path. -
core-ci voted on patch set 12 V +1 09/05/23, 22:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46259
-
Oliver Klee voted on patch set 12 V +1 09/06/23, 07:53
-
Stefan Bürk commented on patch set 12 CR -1 09/06/23, 08:34
-1 due to open discussion. Additionally, recently the "language" argument have been added to the viewhelper in a dedicated change (Markus Klein). We should add tests for that argument in this patch along the way as we are introducing tests now.ActionViewHelper.php:212ReplyI took the solution basically from the *.page ViewHelpers, implemented by Benni. So if we consider this removed code here as broken, it's there too. TBH I would not consider this as broken, and therefore this should not be removed. This implementation targets to mitigate the missing extbase context and not using the ext:extbase UriBuilder. Looking into the extbase UriBuilder code, it also does this the fallback using the current route from the request in `buildBackendUri()`. Following your argumentation it would mean that the old implementation was broken too. See: https://github.com/TYPO3/typo3/blob/f89a5265b9831651751d570293c7f9451be5196d/typo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php#L472-L482 Therefore, I'm not happy with removing this here as it is the replacement how this is done in extbase context and valid. > as the plugin signature needs to be calculated differently (needs to be resolved into pseudo route-names) I don't get this part yet. I added the signature calculation here to have the arguments namespaced (which the *page viewhelper counterparts don't do). However, rethinking this ... argumentnamespacing is "configurable" now for the backend anyway (since v12?) . so maybe we should simply omit the namespacing in this case like the *.page viewhelper and take this in. Tackling the argument namespacing issue for both viewhelpers in a dedicated change ? Maybe let's have a call later Benjamin, but as far as I can see removing this method should not be the way. -
Benjamin Franzke commented on patch set 12 09/06/23, 08:50
Reply
Ok, I've you have the time, do that, but let's not let this patch rot for too long, this should finally be included in next week's release.ActionViewHelper.php:212Reply> Looking into the extbase UriBuilder code, it also does this the fallback using the current route from the request in buildBackendUri(). Following your argumentation it would mean that the old implementation was broken too. Yes, that's broken. Cross plugin linking does only work with explicit route arguments. For that reason it's better to leave that part out in here. -
Stefan Bürk commented on patch set 12 CR 0 09/08/23, 14:41
Reply
DoneActionViewHelper.php:212ReplyDone -
Benni Mack voted on patch set 12 V +1 CR +1 09/08/23, 20:06
-
Stefan Bürk voted on patch set 12 V +2 CR +2 09/08/23, 21:31
-
Stefan Bürk merged patch set 13 09/08/23, 21:41