mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
get_config / unit tests MDL-24977 get_config('a_plugin'); should return something false when there is no config.
It was always casting the result to an object, even when it was an empty array. I changed it to return null in this case. So that if (get_config('a_plugin')) { /* Do something relying on the pugin having config */ ) works.
This commit is contained in:
parent
c3097e1333
commit
bfb82da3e4
@ -1046,7 +1046,11 @@ function get_config($plugin, $name = NULL) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($localcfg) {
|
||||
return (object)$localcfg;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
} else {
|
||||
// this part is not really used any more, but anyway...
|
||||
|
Loading…
x
Reference in New Issue
Block a user