Problem/Motivation
We hard-code a router rebuild in ModuleInstaller::install(). This was added in #2589967: Rebuild routes immediately when modules are installed to prevent the request after submission of the module install form from getting a stale router table.
There are various places where we don't immediately need to do a router rebuild:
1. When batch installing modules during the installer - we only need the router rebuild after the last module is installed, not all the interim ones, because there is no way to hit a route until you get to the end of the installer.
2. In kernel tests where we're not hitting a route even though we're installing modules.
I think we should consider moving the router rebuild to the install form submit, at the end of the UI installer etc. where it is actually needed.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3492438
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
nicxvan commentedComment #3
catchComment #4
nicxvan commentedIs this a duplicate of #2572285: Module enabling and router rebuilding should be done in one transaction
Comment #5
catchIt's more of a revert of #2589967: Rebuild routes immediately when modules are installed I think.
See the comments in ModuleInstaller:
Updated the issue summary with some background.
Comment #6
catchComment #9
catchThe container rebuild issue is a very tricky find.
Comment #10
podarokJavascript webtests fails unrelated
Comment #11
podarokConfigImportAll test failing, looks like missed a place where I need to add a line of code, on me
Comment #12
nicxvan commentedJust commenting to note a discussion in slack between catch podarok and myself: https://drupal.slack.com/archives/C4M1EV8G5/p1767705669400739?thread_ts=...
Comment #13
podarokReady for review
Comment #14
svicer commentedTested MR !14231 via YUSAOpenY distribution (https://github.com/YCloudYUSA/yusaopeny/pull/331)
Environment: Drupal 11.3.2, PHP 8.3
Tested: YUSAOpenY profile installation with small_y and standard presets.
- 871 routes registered (small_y), 801 routes (standard)
- Module enable (dblog, syslog) works correctly
- Routes respond properly after installation
- No errors in watchdog
Patch applies cleanly and routing works as expected during module installation and runtime.
Comment #15
catchPretty sure we can remove the static with the changes here.
Comment #17
nicxvan commentedReading the reviews it looks like we need to remove the street since it's not used.
Add typing, and we can't remove the static since it's a different property.