From 26f408ecc2e11d63d6b90922942ab2b8285593f4 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Wed, 15 May 2024 07:06:35 +0800 Subject: [PATCH] MDL-70441 mod_assign: change condition to check if variable is not empty --- mod/assign/locallib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 045782da25d..88a310be431 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -7896,7 +7896,7 @@ class assign { $options = array('' => get_string('markingworkflowstatenotmarked', 'assign')) + $states; $select = $mform->addElement('select', 'workflowstate', get_string('markingworkflowstate', 'assign'), $options); $mform->addHelpButton('workflowstate', 'markingworkflowstate', 'assign'); - if (isset($data->workflowstate) && !array_key_exists($data->workflowstate, $states)) { + if (!empty($data->workflowstate) && !array_key_exists($data->workflowstate, $states)) { // In a workflow state that user should not be able to change, so freeze workflow selector. // Have to add the state so it shows in the frozen selector. $allworkflowstates = $this->get_all_marking_workflow_states();