Skip to content

Commit

Permalink
fix error when otherindex does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
melanietreitinger committed Dec 6, 2023
1 parent ddb70d8 commit daf05d5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions classes/local/manager/workflow_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,14 @@ public static function change_sortindex($workflowid, $up) {
array(
'sortindex' => $otherindex)
);
$otherworkflow = workflow::from_record($otherrecord);
if (false !== $otherrecord) {
$otherworkflow = workflow::from_record($otherrecord);
$otherworkflow->sortindex = $index;
self::insert_or_update($otherworkflow);
}

$workflow->sortindex = $otherindex;
$otherworkflow->sortindex = $index;
self::insert_or_update($workflow);
self::insert_or_update($otherworkflow);

$transaction->allow_commit();
}
Expand Down

0 comments on commit daf05d5

Please sign in to comment.