[1.x] fix: return empty object if selected mail driver is unavailable #4113
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #0000
The email page is broken in the following scenario:
Changes proposed in this pull request:
Return an empty object if the previously selected mail driver is unavailable.
Reviewers should focus on:
While no driver is selected in the frontend after this change and the page is working again,
mail_driver
in the DB still has the previously selected driver as the value. What we shouldn't do here is change this to another valid driver in core (such aslog
) because extensions might remove existing core drivers. Besides that, it will cause unexpected side effects.The only thing that could be looked at is if this value should be reset to
NULL
. As I see it, resetting it toNULL
would just be a cosmetic change, as Flarum doesn't error when trying to send emails using an inexistent driver (though perhaps it should?).Screenshot
Necessity
Confirmed
composer test
).Required changes: