Problem/Motivation
Follow-up to #3464638: User 1 isn't the super user anymore in Drupal >= 10.3 (and #3496866: Use user 1 for ::getAdministrator if security.enable_super_user is set to true).
The solution to finding an administration user if user 1 is to find the first user with a role called 'administrator' https://git.drupalcode.org/project/default_content_deploy/-/blob/c8f1056... It is not a given that there is a role called 'administrator'.
Steps to reproduce
Install Drupal minimal, build a site adding a administrator role that is not called 'administrator'; or delete the 'administrator' role provided, and make another one. Also set 'security.enable_super_user' to false.
Try to use default content deploy drush commands.
Proposed resolution
Not sure if another project, or drush itself, has already tackled this? If not a resolution could be: Load the roles by is_admin. Then load first user that has any of these named roles.
Comments
Comment #2
ekes commentedComment #3
mkalkbrennerThanks for reporting. Can you provide a patch?
Comment #5
mkalkbrenner