Skip to content
Snippets Groups Projects
Unverified Commit 2a33a600 authored by Kata's avatar Kata Committed by GitHub
Browse files

Fix step and trigger reordering: only change the relevant workflow (#200)

parent a1166edf
No related branches found
No related tags found
No related merge requests found
...@@ -137,8 +137,8 @@ class step_manager extends subplugin_manager { ...@@ -137,8 +137,8 @@ class step_manager extends subplugin_manager {
global $DB; global $DB;
if (isset($toberemoved->sortindex)) { if (isset($toberemoved->sortindex)) {
$subplugins = $DB->get_records_select('tool_lifecycle_step', $subplugins = $DB->get_records_select('tool_lifecycle_step',
"sortindex > $toberemoved->sortindex", 'workflowid = :workflowid AND sortindex > :sortindex',
['workflowid' => $toberemoved->workflowid]); ['workflowid' => $toberemoved->workflowid, 'sortindex' => $toberemoved->sortindex]);
foreach ($subplugins as $record) { foreach ($subplugins as $record) {
$subplugin = step_subplugin::from_record($record); $subplugin = step_subplugin::from_record($record);
$subplugin->sortindex--; $subplugin->sortindex--;
......
...@@ -179,8 +179,8 @@ class trigger_manager extends subplugin_manager { ...@@ -179,8 +179,8 @@ class trigger_manager extends subplugin_manager {
global $DB; global $DB;
if (isset($toberemoved->sortindex)) { if (isset($toberemoved->sortindex)) {
$subplugins = $DB->get_records_select('tool_lifecycle_trigger', $subplugins = $DB->get_records_select('tool_lifecycle_trigger',
"sortindex > $toberemoved->sortindex", 'workflowid = :workflowid AND sortindex > :sortindex',
['workflowid' => $toberemoved->workflowid]); ['workflowid' => $toberemoved->workflowid, 'sortindex' => $toberemoved->sortindex]);
foreach ($subplugins as $record) { foreach ($subplugins as $record) {
$subplugin = trigger_subplugin::from_record($record); $subplugin = trigger_subplugin::from_record($record);
$subplugin->sortindex--; $subplugin->sortindex--;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment