85750[BUGFIX] Ensure proper loading order of EXT:seo and EXT:dashboard
Commit message
Review
-
Code review CR +2 Done
- Garvin Hicking +2
- Benjamin Franzke +1
- Stefan Bürk +1
- Christian Kuhn +1
-
Verified V +2 Done
- Garvin Hicking +2
- Benjamin Franzke +1
- Stefan Bürk +1
- core-ci +1 CI
Issues 3
Files 2
Review log 1721
-
Garvin Hicking uploaded patch set 1 08/23/24, 16:12
-
core-ci voted on patch set 1 V +1 08/23/24, 16:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64090
-
Philipp Kuhlmay commented on patch set 1 08/23/24, 16:54
I cannot say much about the code, if it is the correct way, but at least this implementation works for me.SeoCompilerPass.php:37Wouldn't it be better to name this something like $pagesWithoutMetaDescriptionDefinition? I know this is long but what, if I want to add more widgets there? Then I would use the $definition variable again, to create a new definition? It would be easier to read if there will be another definition like "$pagesWithoutTitleDefinition" when I want to add the according widget, right? -
Garvin Hicking commented on patch set 1 08/23/24, 17:31
SeoCompilerPass.php:37Replysure, feel free to adapt :) -
Garvin Hicking commented on patch set 1 08/23/24, 17:33
If we pursue this, we should create probably a functional test with the extensions loaded and seeing that the registry holds the widgets of all extensions. -
Stefan Bürk commented on patch set 1 08/23/24, 19:13
If I add `dashboard` as suggestion to the `seo` extension `ext_emconf.php` and uninstall/install dashboard dashboard extension gets added before the seo extension in the non-composer PackageStates file. From a quick peak into the package / package manager code thingy the composer.json suggestion should be enough (even for legacy/monorepo mode). I'd suggest to investigate in that area first regarding following questions: * is composer.json suggest enough ? * do we really need to duplicate the suggest(ion) in the ext_emconf.php ? * does this implies more documentation/agresive statement in documentation ? * can `extension:setup` be used to enforce reordering of current package information beside that, in monorepo this may be an issue if added and core contributors does not enable/disable extension. IMO in non-composer installation this should be updated on core updates anyway and then when extension get active/inactive. The current solution would delay it but no longer respecting "loading" order. Maybe it is possible to have something in service.yaml do do a condition like that (is a service already registered) or can be provided so we can do it aka `extension is loaded thingy). But that would be a new feature anyway. Instead of using a "compiler pass" to move that around I would fix the "root cause" and not mitigate the symptom. -
Garvin Hicking uploaded patch set 2
V +108/28/24, 09:10 -
Garvin Hicking updated the commit message in patch set 3 08/28/24, 09:15
-
Garvin Hicking commented on patch set 2 08/28/24, 09:16
Reply
You are great, Stefan, thank you. I learned about the importance of 'suggest' thanks to you. I've adjusted the patch and documented it. ext_emconf.php still is needed for this; all the code is still aligned for that file in non-composer mode. That would be beyond the scope of fixing this situation of missing widget registrations, and is documented that extensions providing classic/legacy support need to do that.Please note that I propose backporting this to v12, to align ext_emconf with composer.json and prevent possible scenarious in existing installations. I am unsure if we should create an "Important.rst" for this edge case, to make people aware they need to regeneration PackageStates.php when performing a minor upgrade and hitting this bug. -
Garvin Hicking commented on patch set 3 08/28/24, 09:17
Reply
No longer needed by removing compiler passes.SeoCompilerPass.php:37ReplyResolved, approach no longer applies. -
core-ci voted on patch set 2 V -1 08/28/24, 09:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64393
-
core-ci voted on patch set 3 V -1 08/28/24, 09:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64394
-
Garvin Hicking uploaded patch set 4
V -108/28/24, 12:01 -
core-ci voted on patch set 4 V +1 08/28/24, 12:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64416
-
Stefan Bürk commented on patch set 4 08/28/24, 17:16
Reply
I'd say execution `extension:setup` is more than enough. That emits the PSR-14 event `PackagesMayHaveChangedEvent`. `TYPO3\CMS\Core\Package\PackageManager` listens on that event `packagesMayHaveChanged()` and executes a new scan of available packages (TBH not tested, just from reading code) - only for non-composer mode. Args - that needs testing - of nothing has changed (no new packages) orderin is not applied as it seems. Maybe we should investigate that first and recondiser that. The cache:warmup command emits also a event the package manager listens, but it also only operates if nothing has been loaded before in non-composer mode. I'd say there is no "simple" way of reordering that. I guess we should fix that in some way first. Without that some needs to either delete the PackageStates.php file or deactive/activate any extension to get it reorderd (which is a weired recommendation for an important rest file anyway). ``` protected function registerPackagesFromConfiguration(array $packages, $registerOnlyNewPackages = false) { $packageStatesHasChanged = false; foreach ($packages as $packageKey => $stateConfiguration) { // ... } if ($packageStatesHasChanged) { $this->sortAndSavePackageStates(); } } ``` I guess we should call sortAndSavePackageStates() anyway or change it to something to save it if resorting changed the order or something else. Something like that. What do you think ? Beside that, I'm fine with 12.4 backport. -
Christian Kuhn commented on patch set 4 CR +1 08/28/24, 20:56
having that suggest in ext_emconf is imho fine. -
Benjamin Franzke voted on patch set 4 CR +1 V +1 08/29/24, 08:32
-
Benjamin Franzke commented on patch set 4 08/29/24, 08:35
Reply
Let's try to be very passive with existing installations. I think it's fine to just ship it as-is to 12.4. Installations that needed widgets would already have noticed that, so I don't see an urgent need to update the `PackageStates.php` for everyone. -
Stefan Bürk commented on patch set 4 CR +1 V +1 08/30/24, 18:39
Reply
I'd say we can discuss this on the dedicated change https://review.typo3.org/c/Packages/TYPO3.CMS/+/85833 but should not be the blocker for this one yet. (I'd say most agency disabled dashboad/not installed it anyway). -
Garvin Hicking voted on patch set 4 CR +2 V +2 09/02/24, 14:07
-
Garvin Hicking merged patch set 5 09/02/24, 14:07