MDL-50670 course: correctly apply defaults for format options

This commit is contained in:
Marina Glancy 2015-06-23 10:09:32 +08:00 committed by Mark Nelson
parent 06e3b6d8ba
commit 98b3fa4c63

View File

@ -700,7 +700,7 @@ abstract class format_base {
if (isset($option['type'])) {
$mform->setType($optionname, $option['type']);
}
if (is_null($mform->getElementValue($optionname)) && isset($option['default'])) {
if (is_null($mform->getElementValue('id')) && isset($option['default'])) {
$mform->setDefault($optionname, $option['default']);
}
}