1
0
mirror of https://github.com/flarum/core.git synced 2025-08-09 01:46:35 +02:00

Merge branch 'refs/heads/v0.1.0-beta.12'

# Conflicts:
#	composer.json
This commit is contained in:
Franz Liedke
2020-03-04 22:56:37 +01:00
5 changed files with 78 additions and 8 deletions

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)