MDL-31238 always return object for plugin settings from get_config()

This prevents multiple creations of objects from NULL which is note a warnings in php54
This commit is contained in:
Petr Skoda
2012-01-21 11:17:18 +01:00
parent 269c884874
commit 057d39bbc1
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1316,7 +1316,7 @@ function get_config($plugin, $name = NULL) {
if ($localcfg) {
return (object)$localcfg;
} else {
return null;
return new stdClass();
}
} 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->assertNull(get_config('filter_name'));
$this->assertIdentical(get_config('filter_name'), new stdClass());
}
public function test_filter_delete_all_for_context() {