]> git.mjollnir.org Git - moodle.git/commitdiff
Fixing a serious bug with PHP 5 only, which caused blocks to lose
authordefacer <defacer>
Sat, 5 Feb 2005 01:32:15 +0000 (01:32 +0000)
committerdefacer <defacer>
Sat, 5 Feb 2005 01:32:15 +0000 (01:32 +0000)
their configuration data (there is an explanation but I don't think
anyone cares).

Actually it was an optimization and I had to disable it. All is fine now.

blocks/moodleblock.class.php

index f0dab688e3b8b6cfa585355bef57eb20fc870614..76b799a040cffcdf3603074fdb98f29178ba0788 100644 (file)
@@ -461,7 +461,11 @@ class block_base {
         if (!empty($instance->configdata)) {
             $this->config = unserialize(base64_decode($instance->configdata));
         }
-        unset($instance->configdata);
+        // [pj] This line below is supposed to be an optimization (we don't need configdata anymore)
+        // but what it does is break in PHP5 because the same instance object will be passed to
+        // this function twice in each page view, and the second time it won't have any configdata
+        // so it won't work correctly. Thus it's commented out.
+        // unset($instance->configdata);
         $this->instance = $instance;
         $this->specialization();
     }