Skip to content

Commit

Permalink
Merge branch 'w04_MDL-31238_m23_php54' of git://github.com/skodak/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Jan 24, 2012
2 parents 5f67e1f + 820a818 commit 9a50502
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
5 changes: 1 addition & 4 deletions lib/enrollib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1039,10 +1039,7 @@ public function get_description_text($instance) {
protected function load_config() {
if (!isset($this->config)) {
$name = $this->get_name();
if (!$config = get_config("enrol_$name")) {
$config = new stdClass();
}
$this->config = $config;
$this->config = get_config("enrol_$name");
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ function get_config($plugin, $name = NULL) {
if ($localcfg) {
return (object)$localcfg;
} else {
return null;
return new stdClass();
}

} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/simpletest/testfilterconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
6 changes: 1 addition & 5 deletions message/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2347,11 +2347,7 @@ function get_message_processor($type) {
* @return object $processors object containing information on message processors
*/
function get_message_output_default_preferences() {
$preferences = get_config('message');
if (!$preferences) {
$preferences = new stdClass();
}
return $preferences;
return get_config('message');
}

/**
Expand Down

0 comments on commit 9a50502

Please sign in to comment.