mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-11 16:35:38 +00:00
extension config vars are only save to settings.xml if a value is set
previously even empty values has been saved, they just needed to be defined in the extension configuration. This may break extensions which do not check if a config var is set.
This commit is contained in:
parent
75f3afdc84
commit
38f2759c5f
|
@ -1039,12 +1039,27 @@ class Settings { /* {{{ */
|
|||
{
|
||||
// search XML node
|
||||
$extnode = $extnodes->addChild('extension');
|
||||
$this->setXMLAttributValue($extnode, 'name', $name);
|
||||
$this->setXMLAttributValue($extnode, 'name', $name);
|
||||
/* New code saves all parameters of the extension which have been set
|
||||
* in configuration form.
|
||||
*/
|
||||
foreach($extension as $fieldname=>$confvalue) {
|
||||
if($confvalue) {
|
||||
$parameter = $extnode->addChild('parameter');
|
||||
$parameter[0] = isset($extension[$fieldname]) ? (is_array($extension[$fieldname]) ? implode(',', $extension[$fieldname]) : $extension[$fieldname]) : '';
|
||||
$this->setXMLAttributValue($parameter, 'name', $fieldname);
|
||||
}
|
||||
}
|
||||
/* Old code saves those parameters listed in the configuration
|
||||
* of the extension.
|
||||
*/
|
||||
/*
|
||||
foreach($GLOBALS['EXT_CONF'][$name]['config'] as $fieldname=>$conf) {
|
||||
$parameter = $extnode->addChild('parameter');
|
||||
$parameter[0] = isset($extension[$fieldname]) ? (is_array($extension[$fieldname]) ? implode(',', $extension[$fieldname]) : $extension[$fieldname]) : '';
|
||||
$this->setXMLAttributValue($parameter, 'name', $fieldname);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
} // foreach
|
||||
|
|
Loading…
Reference in New Issue
Block a user