MDL-56864 forms: allow to remove last tag with forced standard tags

This commit is contained in:
Marina Glancy
2017-11-21 15:29:08 +08:00
parent 58394a6223
commit 3eeca45c23
+5 -1
View File
@@ -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);