From 567eea8aa9040fb6c058f666070d736774314cf2 Mon Sep 17 00:00:00 2001 From: ekes Date: Tue, 17 Dec 2024 13:11:10 +0100 Subject: [PATCH] Remove code to add non-existent administrator role. (#794) * Remove code to add non-existent administrator role. We have added a localgov_admin role that is supplied by localgov_admin_role https://github.com/localgovdrupal/localgov_core/pull/234 and included in this profile https://github.com/localgovdrupal/localgov/commit/0d19a7cfa92fc3dbe6b4d7db7aff174292231a17 This role added to user 1 by core (and drush) automatically as (the only) administrator role at the time of install. * Remove now redundant use statement. --- localgov.install | 6 ------ 1 file changed, 6 deletions(-) diff --git a/localgov.install b/localgov.install index e74ff19..933ff2b 100644 --- a/localgov.install +++ b/localgov.install @@ -5,7 +5,6 @@ * Install functions for the LocalGovInstall installation profile. */ -use Drupal\user\Entity\User; use Drupal\views\Entity\View; /** @@ -19,11 +18,6 @@ function localgov_install() { $config_factory = \Drupal::configFactory(); - // Assign user 1 the "administrator" role. - $user = User::load(1); - $user->roles[] = 'administrator'; - $user->save(); - // Disable the frontpage view. $frontpage_view = View::load('frontpage'); $frontpage_view->setStatus(FALSE)->save();