Skip to content
Snippets Groups Projects
Commit 005d1ef1 authored by John Voskuilen's avatar John Voskuilen
Browse files

Issue #3513045: Error when updating user role (workflow_access)

parent 2e7f0357
No related branches found
No related tags found
No related merge requests found
Pipeline #448964 passed with warnings
...@@ -73,13 +73,11 @@ function workflow_access_workflow_operations($op, ?EntityInterface $entity = NUL ...@@ -73,13 +73,11 @@ function workflow_access_workflow_operations($op, ?EntityInterface $entity = NUL
switch (TRUE) { switch (TRUE) {
case $entity instanceof WorkflowInterface: case $entity instanceof WorkflowInterface:
/** @var \Drupal\workflow\Entity\WorkflowInterface $entity */ /** @var \Drupal\workflow\Entity\WorkflowInterface $entity */
$label = $entity->label();
$wid = $entity->id(); $wid = $entity->id();
break; break;
case $entity instanceof WorkflowState: case $entity instanceof WorkflowState:
/** @var \Drupal\workflow\Entity\WorkflowState $entity */ /** @var \Drupal\workflow\Entity\WorkflowState $entity */
$label = $entity->getWorkflowId();
$wid = $entity->getWorkflowId(); $wid = $entity->getWorkflowId();
break; break;
} }
...@@ -125,6 +123,9 @@ function workflow_access_user_role_update(EntityInterface $entity) { ...@@ -125,6 +123,9 @@ function workflow_access_user_role_update(EntityInterface $entity) {
// is the key for workflow_Access. // is the key for workflow_Access.
/** @var \Drupal\user\RoleInterface $entity */ /** @var \Drupal\user\RoleInterface $entity */
$original_entity = WorkflowTargetEntity::getOriginal($entity); $original_entity = WorkflowTargetEntity::getOriginal($entity);
if (!$original_entity) {
return;
}
if ($entity->getWeight() != $original_entity->getWeight()) { if ($entity->getWeight() != $original_entity->getWeight()) {
// Role's weight has changed. // Role's weight has changed.
node_access_needs_rebuild(TRUE); node_access_needs_rebuild(TRUE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment