Merge branch 'wip-MDL-43024-master' of git://github.com/marinaglancy/moodle
This commit is contained in:
+2
-2
@@ -2426,7 +2426,7 @@ class section_info implements IteratorAggregate {
|
||||
public function __empty($name) {
|
||||
if (method_exists($this, 'get_'.$name) ||
|
||||
property_exists($this, '_'.$name) ||
|
||||
in_array($name, self::$sectionformatoptions[$this->modinfo->get_course()->format])) {
|
||||
array_key_exists($name, self::$sectionformatoptions[$this->modinfo->get_course()->format])) {
|
||||
$value = $this->__get($name);
|
||||
return empty($value);
|
||||
}
|
||||
@@ -2451,7 +2451,7 @@ class section_info implements IteratorAggregate {
|
||||
return $this->cachedformatoptions[$name];
|
||||
}
|
||||
// precheck if the option is defined in format to avoid unnecessary DB queries in get_format_options()
|
||||
if (in_array($name, self::$sectionformatoptions[$this->modinfo->get_course()->format])) {
|
||||
if (array_key_exists($name, self::$sectionformatoptions[$this->modinfo->get_course()->format])) {
|
||||
$formatoptions = course_get_format($this->modinfo->get_course())->get_format_options($this);
|
||||
return $formatoptions[$name];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user