MDL-64151 forms: select element without selection

Select element that is not multiple should export null when nothing is
selected. If the element is displayed there will always be something
selected.
This commit is contained in:
Marina Glancy
2019-04-24 11:40:39 +02:00
parent 09d7853909
commit 90667b82e8
+1 -1
View File
@@ -166,7 +166,7 @@ class MoodleQuickForm_select extends HTML_QuickForm_select implements templatabl
*/
function exportValue(&$submitValues, $assoc = false)
{
$emptyvalue = $this->getMultiple() ? [] : '';
$emptyvalue = $this->getMultiple() ? [] : null;
if (empty($this->_options)) {
return $this->_prepareValue($emptyvalue, $assoc);
}