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...
skodak authored and stronk7 committed Jan 21, 2012
1 parent ef8be3c commit 5da7b220272eea020dd3e4a9b7d10e835ef0bbf1
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/moodlelib.php
  2. +1 −1 lib/simpletest/testfilterconfig.php
View
@@ -1076,7 +1076,7 @@ function get_config($plugin, $name = NULL) {
if ($localcfg) {
return (object)$localcfg;
} else {
- return null;
+ return new stdClass();
}
} 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->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 5da7b22

Please sign in to comment.