Skip to content

Commit

Permalink
Show menu entry if there are workflows other than the default two
Browse files Browse the repository at this point in the history
  • Loading branch information
justusdieckmann committed Feb 27, 2024
1 parent 6eaee27 commit 08919cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ function tool_lifecycle_extend_navigation_course($navigation, $course, $context)
if ($cache->has('workflowactive')) {
$wfexists = $cache->get('workflowactive');
} else {
$wfexists = $DB->record_exists_select('tool_lifecycle_workflow', 'timeactive IS NOT NULL');
$wfexists = $DB->record_exists_sql("SELECT 'yes' FROM {tool_lifecycle_workflow} wf " .
"JOIN {tool_lifecycle_trigger} t ON wf.id = t.workflowid " .
"WHERE wf.timeactive IS NOT NULL AND t.subpluginname NOT IN ('sitecourse', 'delayedcourses')");
$cache->set('workflowactive', $wfexists);
}

Expand Down

0 comments on commit 08919cd

Please sign in to comment.