MDL-70441 mod_assign: change condition to check if variable is not empty

This commit is contained in:
Simey Lameze 2024-05-15 07:06:35 +08:00
parent a7097cd8d4
commit 26f408ecc2

View File

@ -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();