Skip to content

Commit

Permalink
Fix step and trigger reordering: only change the relevant workflow (#200
Browse files Browse the repository at this point in the history
)
  • Loading branch information
olivabigyo authored Mar 14, 2024
1 parent a1166ed commit 2a33a60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions classes/local/manager/step_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ private static function remove_from_sortindex(&$toberemoved) {
global $DB;
if (isset($toberemoved->sortindex)) {
$subplugins = $DB->get_records_select('tool_lifecycle_step',
"sortindex > $toberemoved->sortindex",
['workflowid' => $toberemoved->workflowid]);
'workflowid = :workflowid AND sortindex > :sortindex',
['workflowid' => $toberemoved->workflowid, 'sortindex' => $toberemoved->sortindex]);
foreach ($subplugins as $record) {
$subplugin = step_subplugin::from_record($record);
$subplugin->sortindex--;
Expand Down
4 changes: 2 additions & 2 deletions classes/local/manager/trigger_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ private static function remove_from_sortindex(&$toberemoved) {
global $DB;
if (isset($toberemoved->sortindex)) {
$subplugins = $DB->get_records_select('tool_lifecycle_trigger',
"sortindex > $toberemoved->sortindex",
['workflowid' => $toberemoved->workflowid]);
'workflowid = :workflowid AND sortindex > :sortindex',
['workflowid' => $toberemoved->workflowid, 'sortindex' => $toberemoved->sortindex]);
foreach ($subplugins as $record) {
$subplugin = trigger_subplugin::from_record($record);
$subplugin->sortindex--;
Expand Down

0 comments on commit 2a33a60

Please sign in to comment.