Skip to content

Commit d53281c

Browse files
committed
Only save posted settings to PC
Fixes craftcms/commerce#4006
1 parent b5f17cd commit d53281c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Release Notes for Craft CMS 4
22

3-
## 4.16.17 - 2025-12-04
3+
## Unreleased
4+
5+
- Fixed a bug where all plugin settings were being saved to the project config, rather than just posted settings. ([craftcms/commerce#4006](https://github.com/craftcms/commerce/issues/4006))
6+
7+
## 4.16.17 - 2025-12-0421
48

59
- Fixed a bug where remove buttons within multi-select Selectize inputs weren’t working if the input wasn’t focusend and fully in view. ([#18079](https://github.com/craftcms/cms/issues/18079))
610
- Fixed an error that could occur when executing a GraphQL mutation when the `lazyGqlTypes` config setting was enabled. ([#18014](https://github.com/craftcms/cms/issues/18014))

src/services/Plugins.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,9 @@ public function savePluginSettings(PluginInterface $plugin, array $settings): bo
744744

745745
// Update the plugin’s settings in the project config
746746
$pluginSettings = $plugin->getSettings();
747-
$pluginSettings = $pluginSettings ? ProjectConfigHelper::packAssociativeArrays($pluginSettings->toArray()) : [];
747+
$pluginSettings = $pluginSettings
748+
? ProjectConfigHelper::packAssociativeArrays($pluginSettings->toArray(array_keys($settings)))
749+
: [];
748750
Craft::$app->getProjectConfig()->set(ProjectConfig::PATH_PLUGINS . '.' . $plugin->handle . '.settings', $pluginSettings, "Change settings for plugin “{$plugin->handle}");
749751

750752
$plugin->afterSaveSettings();

0 commit comments

Comments
 (0)