Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We're still performing a manual db_insert() in user_install() to install user 0 and user 1. We should explore leveraging an entity save for that.
Proposed resolution
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#8 | user-install-user-api-2249113-8.patch | 4.77 KB | jessebeach |
#8 | interdiff.txt | 2.58 KB | jessebeach |
#5 | 2249113-5-user-install-use-api.patch | 6.28 KB | tstoeckler |
Comments
Comment #1
tstoecklerLet's see what breaks,
Comment #3
tstoecklerLet's see how far this one goes:
Comment #5
tstoecklerThis should be green.
Btw, as I realize that that's not entirely obvious from the code:
The dependency of User module on Field module is due to ContentEntityDatabaseStorage - and by extension UserStorage - requiring the FieldInfo service which is provided by Field module.
This will be fixed with #2144263: Decouple entity field storage from configurable fields (or a follow-up thereof) at which point the dependency can probably be removed again, but for now it is a dependency, so we should declare it.
Also changed back to using $enable_dependencies = FALSE for performance in installer.
Comment #6
tstoeckler5: 2249113-5-user-install-use-api.patch queued for re-testing.
Comment #7
Berdir#2116363: Unified repository of field definitions (cache + API) should take care of the dependency.
Comment #8
jessebeach CreditAttribution: jessebeach commentedI've reverted the change to
ModuleHandler::install()
. It's erroneous to the issue in this patch.Added two @todos: one for determining the langcode and one for removing the field dependency in User. Both have associated issues.
Comment #9
sunWhat's the default status for new user accounts?
cf. #2257761: Interactive installer tests cause emails to be sent out
Comment #10
jessebeach CreditAttribution: jessebeach commentedActive, with a note in the User Entity base field definition:
Comment #11
BerdirThanks this looks good. We're not changing the default and I don't think the e-mail is related to the default status, as it is only sent later after you filled out the final configuration form where the user already exists AFAIK. drush has a setting to prevent that, see drush si --help.
Comment #12
alexpottCommitted 902098c and pushed to 8.x. Thanks!
Comment #14
tstoeckler@jessebeach: Thanks for the patch update. Extracted the ModuleHandler change into #2267911: Remove pointless condition in ModuleHandler::install().