Skip to content

Commit

Permalink
Rename reset cache function
Browse files Browse the repository at this point in the history
  • Loading branch information
justusdieckmann committed Feb 27, 2024
1 parent 1ba261e commit 6eaee27
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions classes/local/manager/workflow_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public static function activate_workflow($workflowid) {
/**
* Resets the 'does a manual workflow exist?'-cache.
*/
private static function reset_manual_workflow_cache() {
private static function reset_has_workflow_cache() {
$cache = \cache::make('tool_lifecycle', 'application');
$cache->delete('workflowactive');
}
Expand All @@ -268,7 +268,7 @@ public static function handle_action($action, $workflowid) {
}
if ($action === action::WORKFLOW_ACTIVATE) {
self::activate_workflow($workflowid);
self::reset_manual_workflow_cache();
self::reset_has_workflow_cache();
} else if ($action === action::UP_WORKFLOW) {
self::change_sortindex($workflowid, true);
} else if ($action === action::DOWN_WORKFLOW) {
Expand All @@ -279,12 +279,12 @@ public static function handle_action($action, $workflowid) {
self::backup_workflow($workflowid);
} else if ($action === action::WORKFLOW_DISABLE) {
self::disable($workflowid);
self::reset_manual_workflow_cache();
self::reset_has_workflow_cache();
return; // Return, since we do not want to redirect outside to deactivated workflows.
} else if ($action === action::WORKFLOW_ABORTDISABLE) {
self::disable($workflowid);
self::abortprocesses($workflowid);
self::reset_manual_workflow_cache();
self::reset_has_workflow_cache();
return; // Return, since we do not want to redirect outside to deactivated workflows.
} else if ($action === action::WORKFLOW_ABORT) {
self::abortprocesses($workflowid);
Expand All @@ -294,7 +294,7 @@ public static function handle_action($action, $workflowid) {
if (self::get_workflow($workflowid) &&
self::is_removable($workflowid)) {
self::remove($workflowid);
self::reset_manual_workflow_cache();
self::reset_has_workflow_cache();
} else {
\core\notification::add(get_string('workflow_not_removeable', 'tool_lifecycle')
, \core\notification::WARNING);
Expand Down

0 comments on commit 6eaee27

Please sign in to comment.