Closed andrelopez closed 6 years ago
Rather than an empty body, just unset whatever settings you no longer support.
public function setSettings(array $settings)
{
unset($settings['foo'], $settings['bar']);
parent::setSettings($settings);
}
I'll do. Thanks, brandon!
Description
We have a problem where a plugin on Craft2 has some settings in the
plugins
table. We remove those settings on Craft3 so we create a migration to set to null the settings in theplugins
table and removed any method related to settings in the Main class of the plugin. When testing an update from Craft2 to Craft3 we got an error after the Craft3 update. It looks like the plugin's migrations do not have a chance to run before the plugin is loaded and is throwing an error because we don't have a settings model but there is a json in the settings column of the plugin table.A quick fix was Override the
setSettings
function with an empty body in the main plugin class. Glad to hear any thoughts on this fix.Additional info