CorePluginsAdmin.setSystemSettings always saves the plugin settings for all plugins #12826
Labels
Bug
For errors / faults / flaws / inconsistencies etc.
c: Performance
For when we could improve the performance / speed of Matomo.
c: Platform
For Matomo platform changes that aren't impacting any of our APIs but improve the core itself.
Instead, it should only save the plugins for the plugin(s) that is/are being updated. Through the UI, always only one plugin is being updated. Through the API in theory multiple plugins can be updated.
The payload may look like this:
So we should only update the plugin settings for plugins that are in the payload. Ideally, we would check if any value was changed for a plugin but this may be quite hard. Instead, it should be fine though to check the plugin names that are updated and then only save those.
This is to prevent possible data loss, not doing unneeded actions that may happen in a "save" method such as here https://github.com/matomo-org/plugin-QueuedTracking/blob/master/SystemSettings.php#L413-L429 and in other plugins.
It is not 100% bug, but classifying it as a bug as it could cause problems.
Same problem should exist for the method
setUserSettings
The text was updated successfully, but these errors were encountered: