Plugin config of a required plugin should be loaded before the requiring plugin #11681
Labels
Bug
For errors / faults / flaws / inconsistencies etc.
c: Platform
For Matomo platform changes that aren't impacting any of our APIs but improve the core itself.
See comment in #11678 (comment)
There is an issue that
plugins/$pluginName/config/config.php
in each plugin is loaded alphabetically. Ideally, theconfig.php
of a required plugin should have less of a priority so that a plugin that requires another plugin, can overwrite a DI setting of the required plugin.Meaning if a plugin
Acc
requires a pluginCli
, then config forCli
should be loaded first, thenAcc
becauseAcc
requiresCli
. This wayAcc
could overwrite any DI setting fromCli
.Currently,
config.php
files are loaded as they are defined inconfig.ini.php
which is usually alphabetically because of https://github.com/piwik/piwik/blob/3.0.4-b2/core/Plugin/Manager.php#L209-L212 and https://github.com/piwik/piwik/blob/3.0.4-b2/core/Application/Kernel/PluginList.php#L114 (if config file is writable and not changed manually).I presume we could solve it by sorting the plugin list differently in https://github.com/piwik/piwik/blob/3.0.4-b2/core/Plugin/Manager.php#L209-L212 where we list custom plugins first alphabetically, but if there is required plugin we need to list that sort. As this involves looking into
plugin.json
files, we should not do this in thePluginList.php#L114 sort()
as this would be slow on each request and instead only do it when being called inupdatePluginsConfig
https://github.com/piwik/piwik/blob/3.0.4-b2/core/Plugin/Manager.php#L209-L212The text was updated successfully, but these errors were encountered: