Permalink
Browse files

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
  • Loading branch information...
1 parent 269c884 commit 057d39bbc1aaaad39f64192cda2cc6dee4b159be @skodak skodak committed Jan 21, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/moodlelib.php
  2. +1 −1 lib/simpletest/testfilterconfig.php
View
@@ -1316,7 +1316,7 @@ function get_config($plugin, $name = NULL) {
if ($localcfg) {
return (object)$localcfg;
} else {
- return null;
+ return new stdClass();
}
} else {
@@ -747,7 +747,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->assertNull(get_config('filter_name'));
+ $this->assertIdentical(get_config('filter_name'), new stdClass());
}
public function test_filter_delete_all_for_context() {

0 comments on commit 057d39b

Please sign in to comment.