Skip to content

Commit

Permalink
Merge branch 'wip-MDL-43024-master' of git://github.com/marinaglancy/…
Browse files Browse the repository at this point in the history
…moodle
  • Loading branch information
danpoltawski committed Nov 25, 2013
2 parents f5bc16c + 724b00b commit 43e72c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/modinfolib.php
Expand Up @@ -2426,7 +2426,7 @@ public function __isset($name) {
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);
}
Expand All @@ -2451,7 +2451,7 @@ public function __get($name) {
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];
}
Expand Down

0 comments on commit 43e72c1

Please sign in to comment.