Skip to content
Snippets Groups Projects
Commit c754f04f authored by Jared Hancock's avatar Jared Hancock
Browse files

oops: Fixup plugin configuration loading

The code introduced to convert the database values to PHP values introduced
a bug where the configuration would not be saved.
parent 23cfbc8f
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,12 @@ class PluginConfig extends Config {
// Use parent constructor to place configurable information into the
// central config table in a namespace of "plugin.<id>"
parent::Config("plugin.$name");
foreach ($this->getOptions() as $name => $field)
$this->config[$name]['value'] = $field->to_php($this->get($name));
foreach ($this->getOptions() as $name => $field) {
if ($this->exists($name))
$this->config[$name]['value'] = $field->to_php($this->get($name));
elseif ($default = $field->get('default'))
$this->defaults[$name] = $default;
}
}
/* abstract */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment