Skip to content

Commit

Permalink
MDL-31006 revert partially @ get_config()
Browse files Browse the repository at this point in the history
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 4e7397d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/moodlelib.php
Expand Up @@ -1076,7 +1076,7 @@ function get_config($plugin, $name = NULL) {
if ($localcfg) {
return (object)$localcfg;
} else {
return new stdClass();
return null;
}

} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/simpletest/testfilterconfig.php
Expand Up @@ -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() {
Expand Down

0 comments on commit 4e7397d

Please sign in to comment.