Skip to content
Snippets Groups Projects
Commit 178070d9 authored by Tobias Reischmann's avatar Tobias Reischmann
Browse files

Fix notifications for active workflows

parent 32fe33d7
No related branches found
No related tags found
No related merge requests found
...@@ -471,8 +471,8 @@ class workflow_settings { ...@@ -471,8 +471,8 @@ class workflow_settings {
$this->check_permissions(); $this->check_permissions();
// Handle other actions. // Handle other actions.
step_manager::handle_action($action, $subpluginid); step_manager::handle_action($action, $subpluginid, $workflowid);
trigger_manager::handle_action($action, $subpluginid); trigger_manager::handle_action($action, $subpluginid, $workflowid);
workflow_manager::handle_action($action, $workflowid); workflow_manager::handle_action($action, $workflowid);
if ($action === action::TRIGGER_INSTANCE_FORM) { if ($action === action::TRIGGER_INSTANCE_FORM) {
......
...@@ -217,10 +217,12 @@ class step_manager extends subplugin_manager { ...@@ -217,10 +217,12 @@ class step_manager extends subplugin_manager {
* Handles an action for a workflow step. * Handles an action for a workflow step.
* @param string $action action to be executed * @param string $action action to be executed
* @param int $subpluginid id of the step instance * @param int $subpluginid id of the step instance
* @param int $workflowid id of the workflow
*/ */
public static function handle_action($action, $subpluginid) { public static function handle_action($action, $subpluginid, $workflowid) {
if ($step = self::get_step_instance($subpluginid)) { $step = self::get_step_instance($subpluginid);
if (!workflow_manager::is_active($step->workflowid)) { if ($step && $step->workflowid == $workflowid ) {
if (!workflow_manager::is_active($workflowid)) {
if ($action === action::UP_STEP) { if ($action === action::UP_STEP) {
self::change_sortindex($subpluginid, true); self::change_sortindex($subpluginid, true);
} }
......
...@@ -240,11 +240,13 @@ class trigger_manager extends subplugin_manager { ...@@ -240,11 +240,13 @@ class trigger_manager extends subplugin_manager {
/** /**
* Handles an action for a workflow step. * Handles an action for a workflow step.
* @param string $action action to be executed * @param string $action action to be executed
* @param int $subpluginid id of the step instance * @param int $subpluginid id of the trigger instance
* @param int $workflowid id of the workflow
*/ */
public static function handle_action($action, $subpluginid) { public static function handle_action($action, $subpluginid, $workflowid) {
if ($trigger = self::get_instance($subpluginid)) { $trigger = self::get_instance($subpluginid);
if (!workflow_manager::is_active($trigger->workflowid)) { if ($trigger && $trigger->workflowid == $workflowid ) {
if (!workflow_manager::is_active($workflowid)) {
if ($action === action::UP_TRIGGER) { if ($action === action::UP_TRIGGER) {
self::change_sortindex($subpluginid, true); self::change_sortindex($subpluginid, true);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment