diff --git a/lib/form/tags.php b/lib/form/tags.php index 390c723ed58..ef3719f9433 100644 --- a/lib/form/tags.php +++ b/lib/form/tags.php @@ -244,7 +244,11 @@ class MoodleQuickForm_tags extends MoodleQuickForm_autocomplete { */ public function exportValue(&$submitValues, $assoc = false) { if (!$this->is_tagging_enabled()) { - return $assoc ? array($this->getName() => array()) : array(); + return $this->_prepareValue([], $assoc); + } + if ($this->_findValue($submitValues) === '_qf__force_multiselect_submission') { + // Nothing was selected. + return $this->_prepareValue([], $assoc); } return parent::exportValue($submitValues, $assoc);