Skip to content
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...
stronk7 committed Jan 18, 2012
1 parent 9159aeb commit 4e7397ddc704c4ac011222bf6d692320666e0a9e
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/moodlelib.php
  2. +1 −1 lib/simpletest/testfilterconfig.php
@@ -1076,7 +1076,7 @@ function get_config($plugin, $name = NULL) {
if ($localcfg) {
return (object)$localcfg;
} else {
return new stdClass();
return null;
}
} else {
@@ -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.
You can’t perform that action at this time.