Problem/Motivation
In #3112790-6: System and User modules are installed twice we tried to remove the user module installation from install_base_system() and let it be handled with the rest of the modules. This had two impacts:
- Installation from configuration for DrupalCI (couldn't reproduce this fail locally)
- Changing the language that user 0 and user 1 are created in - this is probably a bug in HEAD but changing this behaviour shouldn't happen here.
Proposed resolution
Try remove it and fix the tests.
Remaining tasks
- detect why user module required at install time (probably session)
- remove user module install like #3112790-3: System and User modules are installed twice
- fix tests and document behavior of initial users' creation
User interface changes
None
API changes
TBD
Data model changes
TBD
Release notes snippet
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | 3112866-23.patch | 3.2 KB | andypost |
Comments
Comment #2
xjmThis would be a minor-only change. Since 8.9.x and 9.0.x are now in beta, I'm moving this to 9.1.x. Thanks!
Comment #3
andypostThe comment before the referenced issue was
But the session storage not managed by user module
And I found no traces of usage
\Drupal\user\Authentication\Provider\Cookie::getUserFromSession()at installComment #4
catchThe sessions table used to be created in user_schema() but that hasn't been the case during all of Drupal 8, would be great to remove this special-casing.
Comment #5
andypost@catch to you mean to move session schema from
system_schema()to user's one? or maybe move it to\Drupal\Core\Session\SessionHandleras it already using itComment #6
catch@andypost I mis-remembered where the table was defined (both now and previously), but yes we should move the table creation logic to
\Drupal\Core\Session\SessionHandlerand handle it the same way as the database cache backend does - I actually thought we had already done that but apparently not, and couldn't find an issue either.Comment #7
alexpottLet's see what breaks...
Comment #9
alexpottComment #10
alexpottSo whilst this is true and results in a fix I'm not sure it is the correct fix. InstallerExistingConfigSyncDirectoryMultilingualTest fails in #7 because File is installed before the User module. So adding the dependency works but actually there are still modules like dynamic_page_cache that are still installed first. This is happening because \Drupal\Core\Config\ConfigImporter::createExtensionChangelist() is not taking the required-ness into account. It needs to do the same logic as install_profile_modules() with respect to installing required modules first.
Comment #11
alexpottSomething like this.
Comment #12
andypostAwesome idea with #11 - would be great to delegate ordering to module installer to solve the same way
Comment #14
andypostIt also reminded me about user entity in session layer
Comment #15
andypostI can't find very old issue from early d8 days when user module used to unset required option in info.yml
EDIT something from "small core"
Comment #16
alexpottAh the old code removed modules that do not exist. We already have properly validation around that so we can ignore them here.
@andypost I don't think we can do that because the needs similar but not 100% the same. Like the code in
install_profile_modules()adds in missing dependencies and we should not do that here. And we need to skip modules that don't exist in the ConfigImporter but that's a different concern ininstall_profile_modules().Comment #22
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
Tagging for a reroll.
Comment #23
andyposttest already has the changes so re-roll required only for 2 files
Comment #24
smustgrave commentedThanks for the quick turnaround
Did a quick test of doing a fresh Drupal 10.1.x install and verifying that the user module installs and everything behaves as before.
Comment #26
catchCommitted 9dc5c66 and pushed to 10.1.x. Thanks!