[MODULES] Make default loading attributes available in global config

This commit is contained in:
Diogo Cordeiro 2020-08-04 01:36:21 +01:00 committed by Diogo Peralta Cordeiro
parent 119783f80e
commit 2a863ba746

View File

@ -76,7 +76,12 @@ class GNUsocial
// TODO: put into a static array that makes sure $inst isn't lost. // TODO: put into a static array that makes sure $inst isn't lost.
$inst = new $moduleclass(); $inst = new $moduleclass();
foreach ($attrs as $aname => $avalue) { foreach ($attrs as $aname => $avalue) {
$inst->$aname = $avalue; // Only apply default if a user preference wasn't set
if (common_config($moduleclass, $aname) === false) {
$inst->$aname = $avalue;
// Module attributes shall be part of global config
common_config_set($moduleclass, $aname, $avalue);
}
} }
// Record activated modules for later display/config dump // Record activated modules for later display/config dump