mirror of
https://github.com/flarum/core.git
synced 2025-07-31 05:30:38 +02:00
Add BC layer for mail driver configuration
By commenting out the new methods on the `DriverInterface` and checking for these methods' existence before calling them, old implementations in extensions will not break right away. This will be removed after beta.12 is released, giving extension authors about two months time to update their extensions.
This commit is contained in:
@@ -41,11 +41,15 @@ class ShowMailSettingsController extends AbstractShowController
|
||||
$actual = self::$container->make('mail.driver');
|
||||
$validator = self::$container->make(Factory::class);
|
||||
|
||||
$errors = $configured->validate($settings, $validator);
|
||||
if (method_exists($configured, 'validate')) {
|
||||
$errors = $configured->validate($settings, $validator);
|
||||
} else {
|
||||
$errors = new \Illuminate\Support\MessageBag;
|
||||
}
|
||||
|
||||
return [
|
||||
'drivers' => $drivers,
|
||||
'sending' => $actual->canSend(),
|
||||
'sending' => method_exists($actual, 'canSend') ? $actual->canSend() : true,
|
||||
'errors' => $errors,
|
||||
];
|
||||
}
|
||||
|
Reference in New Issue
Block a user