From 544febe84e3286d6eba567b48c9eef62cee64c30 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 19 Mar 2021 09:03:19 +0100 Subject: [PATCH] RoleForm: Fix self reference when creating a new role without parent --- application/forms/Security/RoleForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/forms/Security/RoleForm.php b/application/forms/Security/RoleForm.php index b7773ca8c..a2eaf0ea3 100644 --- a/application/forms/Security/RoleForm.php +++ b/application/forms/Security/RoleForm.php @@ -551,7 +551,7 @@ class RoleForm extends RepositoryForm return false; } - if (($newName = $this->getValue('name')) !== $this->getIdentifier()) { + if ($this->getIdentifier() && ($newName = $this->getValue('name')) !== $this->getIdentifier()) { $this->repository->update( $this->getBaseTable(), ['parent' => $newName],