Re-add mail settings backwards compatibility layer

This commit is contained in:
Franz Liedke 2020-02-26 23:11:22 +01:00
parent 0fba2c0c0a
commit e7c71ec445
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4

View File

@ -36,7 +36,19 @@ class MailSettingsSerializer extends AbstractSerializer
private function serializeDriver(DriverInterface $driver)
{
return $driver->availableSettings();
$settings = $driver->availableSettings();
if (key($settings) === 0) {
// BACKWARDS COMPATIBILITY: Support a simple list of fields (without
// type or additional metadata).
// Turns ["f1", "f2"] into {"f1": "", "f2": ""}
// @deprecated since 0.1.0-beta.12
$settings = array_reduce($settings, function ($memo, $key) {
return [$key => ''] + $memo;
}, []);
}
return $settings;
}
public function getId($model)