Database error when domino module is included in core.extensions.yml during site install with config

Created on 31 October 2023, about 1 year ago
Updated 7 November 2023, about 1 year ago

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.

  1. During site install, configuration is imported.
  2. The first step during configuration import is to install all the modules defined in core.extensions.yml.
  3. This happens before configuration (such as user roles) have been imported.
  4. When domino is installed, hook domino_install() is triggered which calls domino_cache_flush().
  5. 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.
🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom Leo Pitt

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024