Commit f5ff378c authored by Jordan Barnes's avatar Jordan Barnes Committed by Jakob P
Browse files

Issue #3257273 by j-barnes: "Anonymous or authenticated role ID must not be...

Issue #3257273 by j-barnes: "Anonymous or authenticated role ID must not be assigned manually" error during site install
parent 1bd9a2a8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
 * Creates dummy accounts to aid in testing.
 */

use Drupal\Core\Session\AccountInterface;
use Drupal\user\RoleInterface;

/**
@@ -18,8 +19,10 @@ function qa_accounts_user_role_insert(RoleInterface $role) {
    return;
  }

  if ($role->id() !== AccountInterface::ANONYMOUS_ROLE) {
    \Drupal::service('qa_accounts.create_delete')->createQaAccountForRole($role->id());
  }
}

/**
 * Implements hook_ENTITY_TYPE_delete().
@@ -32,5 +35,7 @@ function qa_accounts_user_role_delete(RoleInterface $role) {
    return;
  }

  if ($role->id() !== AccountInterface::ANONYMOUS_ROLE) {
    \Drupal::service('qa_accounts.create_delete')->deleteQaAccountForRole($role->id());
  }
}