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.

Remaining tasks

API changes

Comments

ekes created an issue. See original summary.

ekes’s picture

Issue summary: View changes
mkalkbrenner’s picture

Thanks for reporting. Can you provide a patch?

  • mkalkbrenner committed 8cf4bd69 on 2.1.x
    Issue #3507221 by ekes, mkalkbrenner: User 1 not super-user and no role...
mkalkbrenner’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.