Review main Merged

72199[FEATURE] Allow tagging of data processors

Thomas Löffler CR +2 V +2 Normal +207 −13 updated 10/20/22, 14:21

Commit message

This adds the possibility to tag data processors
with the "data.processor" tag in the service configuration.

Tagged services will automatically be added to the new
DataProcessorRegistry, which enables DI out of the box.
As a side effect, this allows to define an "identifier",
which can be used as an alias in e.g. TypoScript
configurations.

Note: Tagged services are not automatically set public.
This only happens implicit when fetched via the registry.
In case one still uses the FQCN instead of the alias /
identifier, the service must still be set "public: true"
manually.

All core data processors are tagged and defined by an
identifier. A possible migration in TypoScript would
therefore look like:

Default:
10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor

New possibility:
10 = database-query

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Georg Ringer +1
    • Benni Mack +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Jonas Eberle +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 7

Review log 4359

Show 2234 earlier messages
  1. Thomas Löffler uploaded patch set 1 11/16/21, 21:40

  2. core-ci voted on patch set 1 V +1 11/16/21, 21:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19384

  3. Thomas Löffler updated the commit message in patch set 2 11/17/21, 06:48

  4. core-ci voted on patch set 2 V +1 11/17/21, 07:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19388

  5. Thomas Löffler updated the commit message in patch set 3 11/18/21, 12:21

  6. core-ci voted on patch set 3 V +1 11/18/21, 12:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19504

  7. Benni Mack wrote 11/29/21, 10:21

    Change destination moved from master to main
  8. Benni Mack updated the commit message in patch set 4 11/29/21, 14:10

  9. core-ci voted on patch set 4 V +1 11/29/21, 17:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20108

  10. Benni Mack commented on patch set 4 01/14/22, 12:26

    OK, if we make a feature out of it?
  11. Thomas Löffler uploaded patch set 5 08/11/22, 20:33

  12. Thomas Löffler uploaded patch set 6 08/11/22, 20:34

  13. Thomas Löffler updated the commit message in patch set 7 08/11/22, 20:35

  14. Thomas Löffler commented on patch set 6 08/11/22, 20:35

    Reply

    Sure. And done.
  15. core-ci voted on patch set 6 V +1 08/11/22, 20:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30053

  16. core-ci voted on patch set 7 V +1 08/11/22, 20:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30054

  17. core-ci voted on patch set 5 V +1 08/11/22, 20:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30052

  18. Chris Müller commented on patch set 7 CR -1 08/12/22, 08:25

    As this is a feature we need a feature RST. Also the releases line in the commit message should only contain "main".
  19. Thomas Löffler uploaded patch set 8 08/12/22, 21:39

  20. core-ci voted on patch set 8 V +1 08/12/22, 21:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30130

  21. Chris Müller uploaded patch set 9 08/13/22, 18:22

  22. Chris Müller uploaded patch set 10 08/13/22, 18:23

  23. core-ci voted on patch set 9 V +1 08/13/22, 18:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30151

  24. core-ci voted on patch set 10 V +1 08/13/22, 18:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30152

  25. Chris Müller commented on patch set 10 08/13/22, 18:35

    This does not work for me: page.30 = FLUIDTEMPLATE page.30 { // ... dataProcessing.10 = dataProcessor.siteLanguage dataProcessing.10 { as = language } } Produces the error: Processor class or service name "dataProcessor.siteLanguage" does not exist! Do I miss something? Cleared the DI cache, of course.
  26. Thomas Löffler commented on patch set 10 08/13/22, 21:54

    Reply

    Will check.
  27. Thomas Löffler commented on patch set 10 08/13/22, 22:27

    Reply

    Using not the shortcut syntax and public: true works for me now.
  28. Thomas Löffler uploaded patch set 11 08/13/22, 22:27

  29. core-ci voted on patch set 11 V +1 08/13/22, 22:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30153

  30. Chris Müller uploaded patch set 12 08/14/22, 07:35

  31. Chris Müller commented on patch set 12 08/14/22, 07:37

    Thomas, please check before pushing for new patchsets. I updated the doc yesterday. Pushed it again now.
  32. Chris Müller commented on patch set 12 V +1 CR +1 08/14/22, 07:38

    Reply

    Done
  33. core-ci voted on patch set 12 V +1 08/14/22, 07:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30158

  34. Thomas Löffler commented on patch set 12 08/14/22, 08:54

    Reply

    Sorry.
  1. Christian Kuhn updated the commit message in patch set 13 08/19/22, 08:18

  2. core-ci voted on patch set 13 V +1 08/19/22, 08:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30293

  3. Thomas Löffler voted on patch set 13 V +1 CR +1 08/19/22, 08:28

  4. Chris Müller voted on patch set 13 V +1 CR +1 08/19/22, 13:03

  5. Jonas Eberle voted on patch set 13 V +1 CR +1 09/12/22, 16:05

  6. Benjamin Franzke commented on patch set 13 09/20/22, 07:12

    How about an alternative syntax, using DI tags as we use for similar cases as well: Example: TYPO3\CMS\Frontend\DataProcessing\CommaSeparatedValueProcessor tags: - { name: 'data-processor', identifier: 'comma-separated-value' } Which then allows to use `dataProcessing.20 = comma-separated-value` in TypoScript. Benefits: * In line with other cases like console commands * `public: true` becomes implicits * Typing FQDN vs aliases is basically and provides no *real* technical benifit, its just short (yes, that a bonus for sure) * We could read all available data-processors from DI thanks to tags (e.g. for future modules) and present them in a backend module for developers to look at (like we have for middlewares).
  7. Benjamin Franzke wrote 09/20/22, 07:13

    Topic set to di
  8. Oli Bartsch commented on patch set 13 09/22/22, 07:55

    Reply

    +1 for using this approach.
  9. Oli Bartsch uploaded patch set 14 10/18/22, 22:42

  10. Oli Bartsch commented on patch set 14 10/18/22, 22:51

    Reply

  11. core-ci voted on patch set 14 V -1 10/18/22, 22:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32446

  12. Oli Bartsch uploaded patch set 15 10/18/22, 23:09

  13. core-ci voted on patch set 15 V +1 10/18/22, 23:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32448

  14. Benjamin Franzke commented on patch set 15 10/19/22, 03:43

    Thanks Oli, looks good so far. Only some minor remarks.

    DataProcessorRegistry.php:29

    Maybe be explicit and use Symfony\Component\DependencyInjection\ServiceLocator. (Makes it clear that we could also use $dataProcessorLocator->getProvidedServices() to get a list of tags, e.g. for introspection in backend-configuration-module).

    Services.php:19

    Hm, thanks to the tagged_locator, we actually don't need `setPublic(true)`, because symfony makes the private serivces available to the tagged-locator. So this would only make sense for services that were already marked public. Thefefor I'd say: Let's rather define `public: true` in Services (MenuProcessor) where needed for BC, and drop it here. I would even like if we set `shared: false` only where actually needed (MenuProcessor, GalleryProcessor, LanguageMenuProcessor from what I see).

    Services.yaml:32

    public not needed
  15. Oli Bartsch uploaded patch set 16 10/19/22, 07:56

  16. Oli Bartsch commented on patch set 16 10/19/22, 07:58

    DataProcessorRegistry.php:29 Reply

    Done

    Services.php:19 Reply

    Done

    Services.yaml:32 Reply

    Done
  17. core-ci voted on patch set 16 V +1 10/19/22, 08:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32458

  18. Benni Mack voted on patch set 16 CR +1 10/19/22, 09:34

  19. Benni Mack voted on patch set 16 V +1 10/19/22, 09:44

  20. Georg Ringer voted on patch set 16 CR +1 10/19/22, 10:30

  21. Jonas Eberle commented on patch set 16 V -1 10/20/22, 07:24

    I've found images not being displayed when used with https://review.typo3.org/c/Packages/TYPO3.CMS/+/76162 CType: textmedia field: assets (added 3 images) ``` tt_content.textmedia { templateName = Textmedia dataProcessing { 10 = files references.fieldName = assets } } } ``` The `files` variable is an empty array in the Fluid template.
  22. Oli Bartsch commented on patch set 16 10/20/22, 13:14

    Reply

  23. Jonas Eberle voted on patch set 16 V +1 10/20/22, 14:10

  24. Oli Bartsch voted on patch set 16 V +2 CR +2 10/20/22, 14:21

  25. Oli Bartsch merged patch set 17 10/20/22, 14:21