72027[BUGFIX] Ensure form finisher dependencies can get injected
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Nikita Hovratov +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Chris Müller +1
- Nikita Hovratov +1
- core-ci +1 CI
Issues 3
Files 2
Review log 2428
Show 23 earlier messages
-
Elias Häußler uploaded patch set 1 11/02/21, 18:26
-
Elias Häußler wrote 11/02/21, 18:46
Topic set to di -
core-ci voted on patch set 1 V +1 11/02/21, 18:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18766
-
Chris Müller voted on patch set 1 V +1 11/02/21, 18:57
-
Mathias Brodala commented on patch set 1 CR -1 11/03/21, 07:44
Why not do this in the existing Services.yaml instead? -
Elias Häußler commented on patch set 1 11/03/21, 08:00
Reply
The mentioned switch from `OM::get` to `GU::mI` resulted in existing form finishers no longer getting dependencies injected unless they are public. IMHO this is a breaking change since prior to the change, dependencies were always injected (by the ObjectManager) which is no longer the case (as they not public by default). We could indeed set only the core finishers to "public", but this would not cover finishers from third-party extensions, because prior to mentioned change there was no need to set them public – if I understand it correctly. If we decide to NOT make form finishers public by default, I think we should at least provide an important rst that documents mentioned change and the need for public form finishers for DI. -
Mathias Brodala commented on patch set 1 CR 0 11/03/21, 08:21
Reply
I indeed missed that you make ALL finishers public by their interface. But technically this should also be doable in the Services.yaml AFAIK. -
Elias Häußler commented on patch set 1 11/03/21, 08:26
Reply
You mean services: _instanceof: TYPO3\CMS\Form\Domain\Finishers\FinisherInterface: public: true ? -
Mathias Brodala commented on patch set 1 11/03/21, 08:32
Reply
Exactly, at least do the docs say so: https://symfony.com/doc/current/service_container/tags.html#autoconfiguring-tags -
Elias Häußler commented on patch set 1 11/03/21, 08:44
Reply
I already took this into consideration, but decided against it in oder to streamline this implementation with the ones from other system extensions. But it would also okay for me to change it as described. -
Mathias Brodala commented on patch set 1 11/03/21, 08:46
Reply
Indeed, there are other uses of the PublicServicePass configured via Services.php instead of Services.yaml. So I guess that's fine for now. -
Benjamin Franzke commented on patch set 1 CR -1 11/03/21, 09:07
I agree that #94317 isn't a proper change (it should have checked whether a container entry exists and use PSR-11 container->get() in that case and fallback to ObjectManager->get() together with a deprecation log). Now, it's generally nice to autoconfigure ervices, but that also has a slight drawback: a) Extensions may not have enable Service autoconfiguration b) Finishers may be stateful I'm undecided whether we rather fix #94317 to fallback to ObjectManager, but in any case, if we would want to merge this, then we'd also need to (auto)configure the finishers to be statefull (`shared = false`). We could add that as option to `PublicServicePass`Reply
FYI: _instanceof: via Services.yaml would only apply for the current extension, not all extensions. This kind of global autoconfiguration requires a compiler pass. -
Benjamin Franzke commented on patch set 1 11/03/21, 09:09
Reply
Note: The finishers need to be considered statefull because the Interface implicitly mandates state due to the `setOption[s]()` methods. -
Benjamin Franzke uploaded patch set 2 11/03/21, 09:18
-
Benjamin Franzke uploaded patch set 3 11/03/21, 09:19
-
Elias Häußler commented on patch set 3 11/03/21, 09:25
Reply
Nice catch, thanks! I always forget that public: true implicitly sets shared: true as well... -
core-ci voted on patch set 2 V +1 11/03/21, 09:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18773
-
core-ci voted on patch set 3 V +1 11/03/21, 09:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18774
-
Benjamin Franzke voted on patch set 3 CR +1 11/03/21, 09:58
-
Chris Müller voted on patch set 3 V +1 11/03/21, 19:35
-
Nikita Hovratov updated the commit message in patch set 4 11/04/21, 16:05
-
Nikita Hovratov commented on patch set 3 V +1 CR +1 11/04/21, 16:06
Only commit message adjustments. -
core-ci voted on patch set 4 V +1 11/04/21, 16:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18907
-
Benjamin Franzke voted on patch set 4 V +1 CR +1 11/04/21, 17:01
-
Nikita Hovratov voted on patch set 4 V +1 CR +1 11/04/21, 17:12
-
Chris Müller voted on patch set 4 V +1 11/04/21, 18:01
-
Benjamin Franzke commented on patch set 4 V +2 CR +2 11/05/21, 05:35
Reply
Done -
Benjamin Franzke merged patch set 5 11/05/21, 05:35