Skip to content

Commit 5e4a0ff

Browse files
committed
CMS-2044 - Ensure legacy plugin settings get saved correctly
1 parent 3ed8267 commit 5e4a0ff

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

yii2-adapter/legacy/services/Plugins.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,16 @@ public function switchEdition(string $handle, string $edition): void
251251
*/
252252
public function savePluginSettings(PluginInterface $plugin, array $settings): bool
253253
{
254+
if (is_null($pluginSettings = $plugin->getSettings())) {
255+
return false;
256+
}
257+
258+
/**
259+
* We override this as the legacy service needs
260+
* to save with setting safeOnly to `false`.
261+
*/
262+
$pluginSettings->setAttributes($settings, false);
263+
254264
return app(PluginsService::class)->savePluginSettings($plugin, $settings);
255265
}
256266

0 commit comments

Comments
 (0)