MDL-38147 fixed bug with windows PHP different function behaviour
authorMarina Glancy <marina@moodle.com>
Wed, 27 Mar 2013 06:06:27 +0000 (17:06 +1100)
committerMarina Glancy <marina@moodle.com>
Wed, 27 Mar 2013 06:06:27 +0000 (17:06 +1100)
lib/coursecatlib.php

index c7f0fa5..0faa0fb 100644 (file)
@@ -123,7 +123,7 @@ class coursecat implements renderable, cacheable_object, IteratorAggregate {
         if (array_key_exists($name, self::$coursecatfields)) {
             if ($this->$name === false) {
                 // property was not retrieved from DB, retrieve all not retrieved fields
-                $notretrievedfields = array_diff(self::$coursecatfields, array_filter(self::$coursecatfields));
+                $notretrievedfields = array_diff_key(self::$coursecatfields, array_filter(self::$coursecatfields));
                 $record = $DB->get_record('course_categories', array('id' => $this->id),
                         join(',', array_keys($notretrievedfields)), MUST_EXIST);
                 foreach ($record as $key => $value) {