schematic
schematic copied to clipboard
Default to empty array if settingsModel is broken
If the settingsmodel is broken , default to an empty array.
This is workaround for the Ansel plugin which returns a Noop class instead of a proper settings model, which causes an ErrorException to be thrown.
From Ansel.php
/**
* We have to have this here because reasons (Craft has its faults)
*/
public function createSettingsModel()
{
return new Noop();
}
the Noop class causing an error exception if you try to export it's plugin settings.
<?php
namespace buzzingpixel\ansel;
class Noop
{
public function __call(string $name, array $args)
{
return null;
}
}