From 4fcd97d8c9506b4649ba281b1de81341977ae200 Mon Sep 17 00:00:00 2001 From: ekes Date: Wed, 11 Dec 2024 17:03:08 +0100 Subject: [PATCH 1/2] 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. --- localgov.install | 5 ----- 1 file changed, 5 deletions(-) diff --git a/localgov.install b/localgov.install index e74ff19..fdf5836 100644 --- a/localgov.install +++ b/localgov.install @@ -19,11 +19,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(); From 38e79aa5183b6ae8d2a41f69068e3d3bc45b95db Mon Sep 17 00:00:00 2001 From: ekes Date: Wed, 11 Dec 2024 17:17:04 +0100 Subject: [PATCH 2/2] Remove now redundant use statement. --- localgov.install | 1 - 1 file changed, 1 deletion(-) diff --git a/localgov.install b/localgov.install index fdf5836..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; /**