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

Issue #3418870: Restructure save() method

parent cdecac69
No related branches found
No related tags found
No related merge requests found
Pipeline #90348 passed with warnings
......@@ -222,8 +222,18 @@ class WorkflowManager implements WorkflowManagerInterface {
$entity_type = $entity->getEntityTypeId();
$entity_id = $entity->id();
foreach (WorkflowTransition::loadMultipleByProperties($entity_type, [$entity_id], [], $field_name, $langcode, NULL, 'ASC', $transition_type) as $transition) {
$transition->delete();
switch ($transition_type) {
case 'workflow_transition':
foreach (WorkflowTransition::loadMultipleByProperties($entity_type, [$entity_id], [], $field_name, $langcode, NULL, 'ASC', $transition_type) as $transition) {
$transition->delete();
}
break;
case 'workflow_scheduled_transition':
foreach (WorkflowScheduledTransition::loadMultipleByProperties($entity_type, [$entity_id], [], $field_name, $langcode, NULL, 'ASC', $transition_type) as $transition) {
$transition->delete();
}
break;
}
}
......
......@@ -413,7 +413,7 @@ class WorkflowTransition extends ContentEntityBase implements WorkflowTransition
// N.B. Keep aligned between WorkflowState, ~Transition, ~HistoryAccess.
/*
* Get user's permissions.
* Get user's permissions.
*/
$type_id = $this->getWorkflowId();
if ($user->hasPermission("bypass $type_id workflow_transition access")) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment