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)
This commit is contained in:
Eloy Lafuente (stronk7)
2012-01-19 18:35:39 +01:00
committed by kordan
parent 63abec4487
commit fe0bc2e0be
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1318,7 +1318,7 @@ function get_config($plugin, $name = NULL) {
if ($localcfg) {
return (object)$localcfg;
} else {
return new stdClass();
return null;
}
} else {
+1 -1
View File
@@ -747,7 +747,7 @@ class filter_delete_config_test extends UnitTestCaseUsingDatabase {
$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() {