mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-43024 course: fixed bug for accessing section options
This commit is contained in:
parent
f7434db109
commit
724b00b2b6
1 changed files with 2 additions and 2 deletions
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue