Commit b2e34870 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Read entire _config table on call to get_config_plugin (bug #887400)

get_config_plugin only pulls in records from the given plugin, but it
might as well read the entire (tiny) table, so that for example the
following two calls result in one query rather than two:
 get_plugin_config('artefact', 'internal', 'profilemandatory')
 get_plugin_config('artefact', 'file', 'defaultquota')

Change-Id: I28d74179330178a40d4787bdb9e8e4ed1e0a0e60
Signed-off-by: default avatarRichard Mansfield <>
parent f4a0e178
......@@ -877,11 +877,11 @@ function get_config_plugin($plugintype, $pluginname, $key) {
return $value;
$records = get_records_array($plugintype . '_config', 'plugin', $pluginname, 'field', 'field, value');
$records = get_records_array($plugintype . '_config');
if (!empty($records)) {
foreach($records as $record) {
$CFG->plugin->{$plugintype}->{$pluginname}->{$record->field} = $record->value;
if ($record->field == $key) {
$CFG->plugin->{$plugintype}->{$record->plugin}->{$record->field} = $record->value;
if ($record->field == $key && $record->plugin == $pluginname) {
$value = $record->value;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment