Review main Merged Breaking

72627[!!!][FEATURE] Automatically register ContextMenu item providers

Oli Bartsch CR +2 V +2 Hard +232 −56 updated 12/13/21, 20:15

Commit message

ContextMenu item providers are now automatically tagged
and registered, based on the implemented `ProviderInterface`,
using the auto configuration feature from the DI container.

The registration via
`$GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders']`
has been removed.

To enable the auto configuration, the context information
(table, record identifier, context) is no longer passed as
constructor argument, but instead using the new `setContext()`
method. This is done in the `ContextMenu` class, prior to
any other action, e.g. `canHandle()`.

In case extensions with custom item providers extend
the AbstractProvider, while not overwriting the constructor,
nothing has to be changed. Only the registration via
global TYPO3 configuration should be removed.
Show more Show less

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Benjamin Franzke +1
    • Benni Mack +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Benjamin Franzke +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 11

Review log 1215

  1. Oli Bartsch uploaded patch set 1 12/10/21, 20:12

  2. Benjamin Franzke wrote 12/10/21, 20:22

    Topic set to di
  3. core-ci voted on patch set 1 V -1 12/10/21, 20:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20954

  4. Benjamin Franzke rebased onto patch set 2 12/10/21, 21:28

  5. core-ci voted on patch set 2 V +1 12/10/21, 21:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20963

  6. Benni Mack voted on patch set 2 CR +1 12/13/21, 11:41

  7. Benni Mack voted on patch set 2 V +1 12/13/21, 18:42

  8. Benjamin Franzke commented on patch set 2 CR -1 12/13/21, 19:41

    Services.yaml:31

    I don't think ContextMenu needs to be shared. It doesn't contain state.
  9. Benjamin Franzke uploaded patch set 3 12/13/21, 19:45

  10. Benjamin Franzke commented on patch set 3 12/13/21, 19:45

    Services.yaml:31 Reply

    Done
  11. Benjamin Franzke commented on patch set 3 12/13/21, 19:47

    Services.yaml:31 Reply

    Note: Other cases like ModuleTemplateFactory are defined as shared: false as well, but they are also not required to be shared: false. But of course sth for another cleanup patch, justed wanted to mention why I'd to it differently here.
  12. core-ci voted on patch set 3 V +1 12/13/21, 19:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21043

  13. Benni Mack voted on patch set 3 V +1 CR +1 12/13/21, 20:09

  14. Oli Bartsch voted on patch set 3 V +2 CR +2 12/13/21, 20:15

  15. Oli Bartsch merged patch set 4 12/13/21, 20:15