Permalink
Browse files

MDL-31006 revert partially @ get_config()

The change from null to stdClass() in get_config() was leading to:

1) unit tests not passing.
2) non-equivalent evaluation in conditions (null evals false,
   stdClassi() evals true)
  • Loading branch information...
1 parent 9159aeb commit 4e7397ddc704c4ac011222bf6d692320666e0a9e @stronk7 stronk7 committed Jan 18, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/moodlelib.php
  2. +1 −1 lib/simpletest/testfilterconfig.php
View
2 lib/moodlelib.php
@@ -1076,7 +1076,7 @@ function get_config($plugin, $name = NULL) {
if ($localcfg) {
return (object)$localcfg;
} else {
- return new stdClass();
+ return null;
}
} else {
View
2 lib/simpletest/testfilterconfig.php
@@ -579,7 +579,7 @@ public function test_filter_delete_all_for_filter() {
$expectedconfig = new stdClass;
$expectedconfig->configname = 'Other config value';
$this->assertEqual($expectedconfig, get_config('filter_other'));
- $this->assertFalse(get_config('filter_name'));
+ $this->assertNull(get_config('filter_name'));
}
public function test_filter_delete_all_for_context() {

0 comments on commit 4e7397d

Please sign in to comment.