If domino is installed via drush site:install and passing the "--existing-config" flag, there is a fatal database error:
Query condition 'users_field_data.name IN ()' cannot be empty.
- During site install, configuration is imported.
- The first step during configuration import is to install all the modules defined in core.extensions.yml.
- This happens before configuration (such as user roles) have been imported.
- When domino is installed, hook domino_install() is triggered which calls domino_cache_flush().
- During domino_cache_flush, TestUsers.php:ensureTestUsersPassword() is run. This method attempts to load all users belonging to any defined roles but it fails with a db error as there are no roles available (because config has not yet been imported)
Possible solutions
So there are two possible solutions as I see it:
- Remove domino_cache_flush() from domino_install(), because it can be run before configuration import has been completed.
- (preferred solution): Amend ensureTestUsersPassword() so that it does not fail when roles have not yet been created.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | check-usernames-not-empty-3398032-2.patch | 3.74 KB | leo pitt |
Comments
Comment #2
leo pitt commentedPatch included.
Comment #4
spleshkaGreat stuff, thank you Leo for providing a patch! I've added small code formatting changes & added changelog record. I will also create a new release to make this fix go live.