From 95775ac735f4e08dd9c915316e4704b4f59af488 Mon Sep 17 00:00:00 2001 From: Christoph Ziehr Date: Sun, 22 Nov 2020 18:18:42 +0100 Subject: [PATCH] Update Loader.php The config options are read in the order plugin-standard-values -> template-standard-values -> dokuwiki.php -> local.php -> local.protected.php into DokuWiki. But when entering the configuration manger, they options are displayed in the order dokuwiki.php -> plugin-standard-values -> template-standard-values -> local.php -> local.protected.php This patch fixes the issue, so that the right values are displayed if there are no configs set in local.php or local.protected.php See also https://forum.dokuwiki.org/d/18489-issues-with-modifying-confdokuwikiphp for further information. This is a second version of this change, because on the first try, there was unnoticed php-error. --- lib/plugins/config/core/Loader.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/plugins/config/core/Loader.php b/lib/plugins/config/core/Loader.php index 29f9e8515..a0cdaf160 100644 --- a/lib/plugins/config/core/Loader.php +++ b/lib/plugins/config/core/Loader.php @@ -78,6 +78,10 @@ class Loader { * @return array */ public function loadDefaults() { + + // initialize array + $conf = array(); + // plugins foreach($this->plugins as $plugin) { $conf = array_merge( @@ -99,10 +103,13 @@ class Loader { $this->template ) ); - - // load main files - global $config_cascade; - $conf = $this->loadConfigs($config_cascade['main']['default']); + + // load main files + global $config_cascade; + $conf = array_merge( + $conf, + $this->loadConfigs($config_cascade['main']['default']) + ); return $conf; } -- 2.11.4.GIT