From 1ba261e96b533befc0aaaea1d44e66c61e2cfc77 Mon Sep 17 00:00:00 2001 From: Justus Dieckmann Date: Tue, 27 Feb 2024 13:25:16 +0100 Subject: [PATCH] Show menu point when a manual or automatic workflow is active --- classes/local/manager/workflow_manager.php | 2 +- lib.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/classes/local/manager/workflow_manager.php b/classes/local/manager/workflow_manager.php index 25c09b82..f0bd8a92 100644 --- a/classes/local/manager/workflow_manager.php +++ b/classes/local/manager/workflow_manager.php @@ -249,7 +249,7 @@ public static function activate_workflow($workflowid) { */ private static function reset_manual_workflow_cache() { $cache = \cache::make('tool_lifecycle', 'application'); - $cache->delete('manualworkflowexists'); + $cache->delete('workflowactive'); } /** diff --git a/lib.php b/lib.php index e54a64bf..ff877af5 100644 --- a/lib.php +++ b/lib.php @@ -44,14 +44,14 @@ function tool_lifecycle_extend_navigation_course($navigation, $course, $context) } $cache = cache::make('tool_lifecycle', 'application'); - if ($cache->has('manualworkflowexists')) { - $manualwfexists = $cache->get('manualworkflowexists'); + if ($cache->has('workflowactive')) { + $wfexists = $cache->get('workflowactive'); } else { - $manualwfexists = $DB->record_exists_select('tool_lifecycle_workflow', 'manual = 1 AND timeactive IS NOT NULL'); - $cache->set('manualworkflowsexist', $manualwfexists); + $wfexists = $DB->record_exists_select('tool_lifecycle_workflow', 'timeactive IS NOT NULL'); + $cache->set('workflowactive', $wfexists); } - if (!$manualwfexists) { + if (!$wfexists) { return null; }