Review main Merged Breaking

73058[!!!][FEATURE] New Module Registration API

Oli Bartsch CR +2 V +2 Nightmare +3236 −3093 updated 02/07/22, 09:29

Commit message

This change introduces a new way to register
TYPO3 Backend Modules.

Each module is now registered during build-time
in a dedicated registry. Therefore, The registration
is moved from ext_tables.php to the
Configuration/Backend/Modules.php file.

Accessing the registered modules can be done via
a central API, the ModuleProvider class. This class
takes care of access permissions and further
processing (e.g. module menu generation).

$GLOBALS[TBE_MODULES] is fully removed as no sane
backwards-compatibility (for a use-case) is available.

A new PSR-14 event BeforeModuleCreationEvent is added,
which allows to manipulate a module configuration, before
it is used to create and register the module.

Existing registrations do no longer work. However, to support
extenion authors in maintaining multiple versions, the previously
used API methods (e.g. `addModule` and `registerModule`) will
stay until TYPO3 v13.0. No trigger_error() is used, so extension
authors use the Extension Scanner to detect usages.

Executed commands:

   composer u typo3/cms-styleguide

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Christian Kuhn +1
  • Verified V +2 Done
    • Benni Mack +2
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 121

Show 101 more files

Review log 74132

Show 58107 earlier messages
  1. Oli Bartsch uploaded patch set 1 01/18/22, 23:56

  2. core-ci voted on patch set 1 V -1 01/19/22, 00:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22241

  3. Benni Mack commented on patch set 1 01/19/22, 07:44

    ModuleProvider.php:220

    you can use the LanguageServiceFactory here, and not rely on the global object anymore
  4. Benni Mack uploaded patch set 2 01/27/22, 22:04

  5. core-ci voted on patch set 2 V -1 01/27/22, 22:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22600

  6. Benni Mack uploaded patch set 3 01/27/22, 22:40

  7. core-ci voted on patch set 3 V -1 01/27/22, 22:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22603

  8. Oli Bartsch uploaded patch set 4 01/28/22, 12:32

  9. core-ci voted on patch set 4 V -1 01/28/22, 12:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22620

  10. Oli Bartsch uploaded patch set 5 01/28/22, 15:47

  11. core-ci voted on patch set 5 V -1 01/28/22, 16:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22628

  12. Oli Bartsch uploaded patch set 6 01/28/22, 17:07

  13. core-ci voted on patch set 6 V -1 01/28/22, 17:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22630

  14. Oli Bartsch uploaded patch set 7 01/28/22, 17:29

  15. core-ci voted on patch set 7 V -1 01/28/22, 17:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22631

  16. Oli Bartsch uploaded patch set 8 01/28/22, 22:16

  17. core-ci voted on patch set 8 V -1 01/28/22, 22:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22640

  18. Oli Bartsch uploaded patch set 9 01/28/22, 23:08

  19. core-ci voted on patch set 9 V -1 01/28/22, 23:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22642

  20. Benni Mack uploaded patch set 10 01/31/22, 13:53

  21. core-ci voted on patch set 10 V -1 01/31/22, 14:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22805

  22. Benni Mack marked it ready for review 01/31/22, 16:30

  23. Benni Mack uploaded patch set 11 02/01/22, 08:57

  24. core-ci voted on patch set 11 V -1 02/01/22, 09:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22864

  25. Benni Mack uploaded patch set 12 02/01/22, 10:03

  26. core-ci voted on patch set 12 V -1 02/01/22, 10:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22867

  27. Benni Mack uploaded patch set 13 02/01/22, 11:13

  28. core-ci voted on patch set 13 V -1 02/01/22, 11:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22868

  29. Benni Mack uploaded patch set 14 02/01/22, 12:25

  30. Benni Mack uploaded patch set 15 02/01/22, 12:41

  31. core-ci voted on patch set 14 V -1 02/01/22, 12:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22869

  32. core-ci voted on patch set 15 V -1 02/01/22, 12:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22872

  33. Oli Bartsch uploaded patch set 16 02/01/22, 16:47

  34. core-ci voted on patch set 16 V -1 02/01/22, 17:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22884

  35. Oli Bartsch uploaded patch set 17 02/01/22, 17:17

  36. core-ci voted on patch set 17 V -1 02/01/22, 17:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22885

  37. Oli Bartsch uploaded patch set 18 02/01/22, 17:45

  38. core-ci voted on patch set 18 V -1 02/01/22, 18:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22888

  39. Oli Bartsch uploaded patch set 19 02/01/22, 20:53

  40. core-ci voted on patch set 19 V -1 02/01/22, 21:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22894

  41. Benni Mack uploaded patch set 20 02/02/22, 08:12

  42. core-ci voted on patch set 20 V -1 02/02/22, 08:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22898

  43. Benni Mack uploaded patch set 21 02/02/22, 10:22

  44. core-ci voted on patch set 21 V -1 02/02/22, 10:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22899

  45. Benni Mack uploaded patch set 22 02/02/22, 11:59

  46. Benni Mack commented on patch set 22 02/02/22, 11:59

    ModuleProvider.php:220 Reply

    Done
  47. core-ci voted on patch set 22 V -1 02/02/22, 12:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22902

  48. Benni Mack uploaded patch set 23 02/02/22, 12:27

  49. core-ci voted on patch set 23 V -1 02/02/22, 12:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22904

  50. Benni Mack uploaded patch set 24 02/02/22, 13:59

  51. core-ci voted on patch set 24 V -1 02/02/22, 14:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22906

  52. Benni Mack updated the commit message in patch set 25 02/02/22, 16:09

  53. core-ci voted on patch set 25 V -1 02/02/22, 16:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22909

  54. Benni Mack uploaded patch set 26 02/02/22, 16:25

  55. core-ci voted on patch set 26 V -1 02/02/22, 16:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22910

  56. Benni Mack uploaded patch set 27 02/02/22, 16:53

  57. core-ci voted on patch set 27 V -1 02/02/22, 17:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22911

  58. Benni Mack uploaded patch set 28 02/02/22, 17:26

  59. core-ci voted on patch set 28 V -1 02/02/22, 17:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22912

  60. Oli Bartsch uploaded patch set 29 02/02/22, 19:15

  61. Oli Bartsch uploaded patch set 30 02/02/22, 19:21

  62. core-ci voted on patch set 29 V -1 02/02/22, 19:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22918

  63. core-ci voted on patch set 30 V -1 02/02/22, 19:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22919

  64. Benni Mack uploaded patch set 31 02/02/22, 19:42

  65. core-ci voted on patch set 31 V -1 02/02/22, 19:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22920

  66. Benni Mack uploaded patch set 32 02/02/22, 20:01

  67. Benni Mack uploaded patch set 33 02/02/22, 20:15

  68. core-ci voted on patch set 32 V -1 02/02/22, 20:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22921

  69. core-ci voted on patch set 33 V -1 02/02/22, 20:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22922

  70. Oli Bartsch uploaded patch set 34 02/02/22, 21:16

  71. core-ci voted on patch set 34 V -1 02/02/22, 21:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22925

  72. Oli Bartsch uploaded patch set 35 02/02/22, 23:16

  73. core-ci voted on patch set 35 V -1 02/02/22, 23:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22928

  74. Oli Bartsch uploaded patch set 36 02/03/22, 00:00

  75. core-ci voted on patch set 36 V -1 02/03/22, 00:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22929

  76. Oli Bartsch uploaded patch set 37 02/03/22, 01:17

  77. core-ci voted on patch set 37 V +1 02/03/22, 01:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22931

  78. Benjamin Franzke commented on patch set 37 02/03/22, 07:43

    ExtensionManagementUtility.php:822

    I would suggest to store a reference to the router in $moduleRegistry->registerRoutesForModules (when called from the service provider) Then, whenever moduleRegistry->addModule() is invoked, the routes can be added to the router (as then a router reference is available) even after the initial route initialization. That means Router and ModuleRegistry state will *always* match, and it doens't matter whether Router or ModuleRegistry are initialized first. Then this registerRouteForModule call in here would be removed.
  79. Christian Kuhn commented on patch set 37 02/03/22, 10:15

    LiveSearchToolbarItem.php:31

    when you're changing these to property promotion anyways, please go with readonly, or is there any reason to write that property again?

    AboutController.php:40

    controllers really should go readonly here.

    AboutController.php:96

    great seeing this gone.

    BackendController.php:165

    we still need this explicit exclution of 'user' / 'help' here? is there a better solution on the way, maybe with another patch?

    PageLayoutController.php:160

    really. please go readonly if you change that anyways. either do that, or don't switch to property promotion with this patch.

    ModuleRegistry.php:27

    do we need singleton here? couldn't that be done with a shared service, or is this just a fallback / to-be-sure thing?
  80. Benjamin Franzke commented on patch set 37 02/03/22, 10:22

    ModuleRegistry.php:27 Reply

    Not shared but public, but yea following is actually interchangable: Singleton === public But SingletonInterface often helps with unit test that otherwise require alot of refactoring because `addSingletonInstance` is easier than `addInstance` when an unknown amount of instances is consumed. So: we never defined what to use for new code. I don't have a strong opinion here, but think public: true would be sufficient for new services, but SingletonInterface is "ok" in case it makes the patch cleaner in order to avoid 100 tests to be rewritten. In this special case though – as ModuleRegistry is referenced in a ServiceProvider, it would actually be the cleanest to define a factory in a ServiceProvider as well. (I see all ServiceProviders as minimal subset that can operate on it's own, without full-blown symfony DI, so I like to keep all ServiceProvider dependencies defined in ServiceProviders)
  81. Benjamin Franzke commented on patch set 37 02/03/22, 10:23

    ModuleRegistry.php:27 Reply

    I meant "not shared" in a way like: It's shared anyway (and of course it should be shared), but "public" defaults to false and that's what needs to be defined.
  82. Oli Bartsch uploaded patch set 38 02/03/22, 14:29

  83. core-ci voted on patch set 38 V +1 02/03/22, 14:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22953

  84. Oli Bartsch uploaded patch set 39 02/03/22, 16:22

  85. Oli Bartsch commented on patch set 39 02/03/22, 16:23

    LiveSearchToolbarItem.php:31 Reply

    Done

    AboutController.php:40 Reply

    Done

    BackendController.php:165 Reply

    Done

    PageLayoutController.php:160 Reply

    Done
  86. core-ci voted on patch set 39 V +1 02/03/22, 16:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22956

  87. Oli Bartsch uploaded patch set 40 02/03/22, 16:45

  88. core-ci voted on patch set 40 V +1 02/03/22, 16:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22959

  89. Oli Bartsch uploaded patch set 41 02/03/22, 18:18

  90. core-ci voted on patch set 41 V -1 02/03/22, 18:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22967

  91. Oli Bartsch uploaded patch set 42 02/03/22, 18:49

  92. core-ci voted on patch set 42 V -1 02/03/22, 19:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22969

  93. Oli Bartsch uploaded patch set 43 02/04/22, 01:24

  94. core-ci voted on patch set 43 V -1 02/04/22, 01:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22986

  95. Oli Bartsch uploaded patch set 44 02/04/22, 11:46

  96. core-ci voted on patch set 44 V -1 02/04/22, 12:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22994

  97. Oli Bartsch uploaded patch set 45 02/04/22, 16:53

  98. core-ci voted on patch set 45 V -1 02/04/22, 16:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23008

  99. Oli Bartsch uploaded patch set 46 02/04/22, 17:01

  100. core-ci voted on patch set 46 V -1 02/04/22, 17:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23009

  101. Oli Bartsch uploaded patch set 47 02/04/22, 17:12

  102. Oli Bartsch commented on patch set 46 02/04/22, 17:12

    ExtensionManagementUtility.php:822 Reply

    Done
  103. core-ci voted on patch set 47 V -1 02/04/22, 17:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23011

  104. Oli Bartsch uploaded patch set 48 02/04/22, 17:31

  105. core-ci voted on patch set 48 V +1 02/04/22, 17:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23014

  106. Oli Bartsch uploaded patch set 49 02/04/22, 17:50

  107. core-ci voted on patch set 49 V +1 02/04/22, 18:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23015

  1. Oli Bartsch uploaded patch set 50 02/04/22, 18:11

  2. core-ci voted on patch set 50 V -1 02/04/22, 18:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23016

  3. Oli Bartsch uploaded patch set 51 02/04/22, 21:05

  4. core-ci voted on patch set 51 V +1 02/04/22, 21:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23022

  5. Oli Bartsch uploaded patch set 52 02/04/22, 21:20

  6. core-ci voted on patch set 52 V +1 02/04/22, 21:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23023

  7. Benjamin Franzke uploaded patch set 53 02/04/22, 21:58

  8. Benjamin Franzke commented on patch set 53 02/04/22, 21:58

    ModuleRegistry.php:27 Reply

    Done

    ServiceProvider.php:104

    This injection means that ModuleProvider needs to be defined as factory here. Otherwise requesting /typo3/, when the system is not yet installed will lead to: (1/1) #1519978105 TYPO3\CMS\Core\DependencyInjection\NotFoundException Container entry "TYPO3\CMS\Backend\Module\ModuleProvider" is not available. adapted in patchset 53.
  9. Benjamin Franzke commented on patch set 53 02/04/22, 22:08

    ServiceProvider.php:209

    modulesFromPackages
  10. core-ci voted on patch set 53 V +1 02/04/22, 22:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23024

  11. Oli Bartsch uploaded patch set 54 02/04/22, 23:33

  12. Oli Bartsch commented on patch set 54 02/04/22, 23:33

    ServiceProvider.php:209 Reply

    Done
  13. core-ci voted on patch set 54 V -1 02/04/22, 23:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23026

  14. Oli Bartsch uploaded patch set 55 02/04/22, 23:48

  15. core-ci voted on patch set 55 V -1 02/04/22, 23:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23027

  16. Oli Bartsch uploaded patch set 56 02/05/22, 00:02

  17. core-ci voted on patch set 56 V +1 02/05/22, 00:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23028

  18. Benjamin Franzke uploaded patch set 57 02/05/22, 07:00

  19. core-ci voted on patch set 57 V +1 02/05/22, 07:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23034

  20. Stefan Bürk uploaded patch set 58 02/06/22, 12:54

  21. core-ci voted on patch set 58 V +1 02/06/22, 13:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23096

  22. Benni Mack voted on patch set 58 V +1 CR +1 02/07/22, 09:17

  23. Christian Kuhn voted on patch set 58 V +1 CR +1 02/07/22, 09:27

  24. Benni Mack commented on patch set 58 V +2 CR +2 02/07/22, 09:29

    Thanks, a big change, finally (I've been wanting to do this for 5 years)
  25. Benni Mack merged patch set 59 02/07/22, 09:29