From: martinlanghoff Date: Tue, 16 Jan 2007 23:25:19 +0000 (+0000) Subject: get_config(): return a single value instead of a record when called with 2 params X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9220fba59803dcea39723cb154c37f05d8d66911;p=moodle.git get_config(): return a single value instead of a record when called with 2 params get_config() was meant to return a single value when called with 2 params, however, it never did. Change it to Do The Right Thing, and audit all callers. --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index c18904ea8e..2112911223 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -601,6 +601,9 @@ function set_config($name, $value, $plugin=NULL) { * generating $CFG safely from the database without overwriting * existing values. * + * If called with 2 parameters it will return a $string single + * value or false of the value is not found. + * * @param string $plugin * @param string $name * @uses $CFG @@ -613,9 +616,9 @@ function get_config($plugin=NULL, $name=NULL) { if (!empty($name)) { // the user is asking for a specific value if (!empty($plugin)) { - return get_record('config_plugins', 'plugin' , $plugin, 'name', $name); + return get_field('config_plugins', 'value', 'plugin' , $plugin, 'name', $name); } else { - return get_record('config', 'name', $name); + return get_field('config', 'value', 'name', $name); } }