Review main Abandoned

85917[FEATURE] Add 'missing seo title' widget for EXT:seo

Philipp Kuhlmay CR 0 V 0 Hard +272 −4 updated 04/13/25, 12:04

Commit message

This adds a new widget for EXT:seo.

Included widget:
* Pages with missing SEO title

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 8

Review log 2429

Show 4 earlier messages
  1. Philipp Kuhlmay uploaded patch set 1 09/06/24, 15:21

  2. Philipp Kuhlmay wrote 09/06/24, 15:21

    Set private
  3. Philipp Kuhlmay marked it work in progress 09/06/24, 15:21

  4. Philipp Kuhlmay uploaded patch set 2 09/06/24, 15:37

  1. Philipp Kuhlmay uploaded patch set 3 09/06/24, 15:49

  2. Philipp Kuhlmay uploaded patch set 4 09/10/24, 20:27

  3. Philipp Kuhlmay marked it ready for review 09/10/24, 20:32

  4. Philipp Kuhlmay uploaded patch set 5 09/13/24, 10:00

  5. Philipp Kuhlmay uploaded patch set 6 09/13/24, 10:36

  6. Philipp Kuhlmay uploaded patch set 7 09/13/24, 10:38

  7. Philipp Kuhlmay uploaded patch set 8 09/13/24, 10:39

  8. Philipp Kuhlmay uploaded patch set 9 09/13/24, 11:03

  9. Philipp Kuhlmay uploaded patch set 10 09/13/24, 11:16

  10. Philipp Kuhlmay uploaded patch set 11 09/13/24, 11:19

  11. Philipp Kuhlmay wrote 09/14/24, 12:03

    Unset private
  12. Philipp Kuhlmay updated the commit message in patch set 12 09/14/24, 12:06

  13. core-ci voted on patch set 12 V -1 09/14/24, 12:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65757

  14. Philipp Kuhlmay uploaded patch set 13 V -1 09/14/24, 14:53

  15. Philipp Kuhlmay uploaded patch set 14 09/14/24, 14:54

  16. core-ci voted on patch set 14 V +1 09/14/24, 15:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65761

  17. core-ci voted on patch set 13 V +1 09/14/24, 15:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65760

  18. Philipp Kuhlmay uploaded patch set 15 V +1 09/14/24, 15:08

  19. core-ci voted on patch set 15 V +1 09/14/24, 15:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65762

  20. Garvin Hicking commented on patch set 15 CR -1 09/14/24, 16:39

    Unresolved

    Thinking about this, this all kind of reveals that options like "limit" and "fieldname" should IMO be GUI/user-specified options, and probably allow to define any kind of tt_content field and not just hardcoded ones (same with hardcoded limit). I think this one is worth having more conceptual thoughts before going down a road that makes future implementations/changes harder...?

    SEOPagesDataProvider.php:39

    even though this class is labelled internal I feel like custom extensions might have defined widgets based on this, with other options. So the "fieldName" should IMO default to "description" to be not breaking. Also I think renaming this class imposes a similar problem. Custom widget implementations will break with a renamed provider. Maybe better to provide an abstract provider here which is extended individually for the existing dataprovider and the new one? like: - abstract seopagesprovider - pageswithoutdescriptionprovider extends abstract - pageswithouttitleprovider extends abstract Probably also implement an interface that the abstract implements for proper typing. Another option could be to just copy&paste the implementations and have no extra abstraction.
  21. Stefan Bürk commented on patch set 15 CR -1 09/14/24, 23:38

    Unresolved

    -1 now as this change makes the implementation even worser. See the bunch of comments for detaild **why-not**. Note that I will rise to -2 if change would not be properly streamlined instead of using bad-habit even more.

    SEOPagesDataProvider.php:39 Reply Unresolved

    @gh@faktor-e.de @typo3@treupo.de Flooding service class construtors with configuration arguments is a real antipattern, and this change now further extended that bad habit. I really dislike that. Beside that - this is literally broken. This service is retrieved from the DI container as shared service, which means that it is only created once and all reieving places get the same (shared) instance with the same configuration calling the constructor only once. `$limit` and `$excludedDoktypes` are configured already within the `Services.yaml`, which would now break if someone has annotated that service in one of their classes because fieldname would not be provided (aka breaking). This change registers now 2 widgets in `Services.yaml` in a loop - and also "setting" this service to the service configuration with "hardcoded" values with dynamic service aliases which are than used to configure the service for these 3 values. Services should be `shared` and `stateles` which this "manual" instance providing violets even more. That means, that the service instance with the last value is used in "all" created widgets (sharing the same setup), Adding both "widgets" now leads to the exact same output. It would be better to move limit & excludeDokTypes to the widgets configuration (options) and remove them here from the constructor in the long term. I would make them nullable for now and remove the `Services.yaml` entry for this service. The constructor could than add a check if `$limit` and/or `$excludedDoktypes` recieves non null-values and emit a deprecation notifing that these option needs to be configured for the widgets configuration then. Albeit Services.php is hard to make these options "configurable". So maybe we leave the deprecation out. Just thinking about possible ways here, without deciding one. We could keep the current one as is and deprecated it completly, introducing a new one build up properly (see following description) and wire that to the current and new widget. I'd say that would be the best way here. Hurray hurray when we got finally real "per-widget" dashboard instance configuration !!!!! (Instead of adding a bunch of hard-wired widgets it would have been better to improve the Widgets API first to make it more usable for core and custom widgets and finally remove these kind of hard wired configuration options violating DI principles. `getPages()` should get now the options handed over: ```php getPages(int $limit, array $excludeDokTypes, string $fieldName) ``` and also pass them down to the private methods - the usage of the original properties should be changed to used the passed option values. > abstract seopagesprovider hell - no. If the DataProvider behaviour needs to be changed, authors should implement their own widget and passing their own dataprovider / repository class. > Probably also implement an interface that the abstract implements for proper typing. hell - no. again. This is a internal service. However, having only one public method this may be okaish (for the "new" implementation described above). Howerver, with the Services.php construct it is hard to define a custom implementation based on that interface for the shipped widgets anyway. Thus I'm eager we leave that out here, as developers need to implement their own widget anyway and can use their custom DataProvider service anyway. **Naming** I would keep for the current and to-be deprecated service `PagesWithoutDescriptionWidget` and for the new implementation based on the descibed way above: `MissingPagesFieldWidgetDataProvider` > Garvin: > even though this class is labelled internal I feel like custom extensions might have defined widgets based on this, with other options. > > Also I think renaming this class imposes a similar problem. Custom widget implementations will break with a renamed provider. `@internal` means it is internal and it can change even on patchlevel taken as not breaking even if breaking, includes deletion, renaming, moving, changing signatures. Point. It does not matter if someone does so or not. In cases when something has been public available for a long time and marked as internal and there a real and usefull extension out their it may considered in another way. But these widget have been marked as internal from the start and thus an excemption must not be considered in generel. However, due to having the Services.yaml configution until now we may still deprecated this internal class but not changing it further and instead make new class.

    SEOPagesDataProvider.php:97 Unresolved

    should be passed in as method argument instead of instance property. Beside that, fieldname should be checked if it is contained in the select list - otherwise it may lead to weired results ;).

    SEOPagesWidget.php:30 Unresolved

    Don't like that nameing. What about `PagesWithoutFieldWidget` instead? Note that the fluid template should follow the same name.

    Services.php:42 Unresolved

    Please don't use a loop for registering service. We do every service complelty by hand - to avoid later additional conditional things.

    Services.php:44 Unresolved

    See comments for the DataProvider class. A service should be stateless and shared, here dedicated instances of a service classes are created and provided as different (dynamic) aliased service within the container and different state configurations. Let's make that DataProvider state and configuration less (described as comment in the DataProvider class) and drop that here. For the single widget creation below, add the required configuration to the widget class as `$options` values - at least these which are missing (`limit` and `excludedDokTypes`). Within the Widget implementation `SEOPagesWidget` read the options from the widget options and pass them on DataProvider->getPage(...) calls then.
  22. Philipp Kuhlmay marked it work in progress 09/15/24, 08:18

  23. Philipp Kuhlmay uploaded patch set 16 CR -1 V +1 11/22/24, 14:04

  24. core-ci voted on patch set 16 V +1 11/22/24, 14:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70039

  25. Benni Mack abandoned the change 04/13/25, 12:04

    abandoned, can be revived later.