Skip to content

Commit 3beb41b

Browse files
committed
process_courses: no processing if there is no process workflowid
1 parent fbb7593 commit 3beb41b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

classes/local/manager/process_manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static function create_process($courseid, $workflowid) {
6565

6666
/**
6767
* Creates a process based on a manual trigger.
68-
* @param int $courseid Id of the course to be triggerd.
68+
* @param int $courseid Id of the course to be triggered.
6969
* @param int $triggerid Id of the triggering trigger.
7070
* @return process the triggered process instance.
7171
* @throws \moodle_exception for invalid workflow definition or missing trigger.

classes/local/manager/workflow_manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public static function abortprocesses($workflowid) {
132132
}
133133

134134
/**
135-
* Returns a workflow instance if one with the is is available.
135+
* Returns a workflow instance if one with the id is available.
136136
*
137137
* @param int $workflowid id of the workflow
138138
* @return workflow|null

classes/processor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public function call_trigger() {
8989
public function process_courses() {
9090
// For each process in process table.
9191
foreach (process_manager::get_processes() as $process) {
92-
// Process only if the process has workflow id.
93-
while ($process->workflowid) {
92+
// Process only if the process has a valid workflow id.
93+
if (is_int($process->workflowid)) {
9494
// New workflows with lifecycle version 4.4 and beneath did not have to have a step.
9595
if ($process->stepindex == 0) {
9696
if (!process_manager::proceed_process($process)) {

0 commit comments

Comments
 (0)