Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Fix toasts in actions not being shown #10828

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Conversation

jasonvarga
Copy link
Member

@jasonvarga jasonvarga commented Sep 23, 2024

When using the Toast facade in an action request, the toast would not be shown.

This is because the action requests were expecting blob types, not json, so they weren't being picked up.

I noticed this in #10264 when adding a toast in an EntryDeleting listener.

Event::listen(function (EntryDeleting $event) {
    Toast::error('Cannot save entry ['.$event->entry->title.'] because of a reason.');
    return false;
});

The action would complete, but the entry would be deleted, and you'd get no feedback. With this PR you will at least get the toast about why it wasn't deleted.

CleanShot 2024-09-23 at 11 42 26

(In #10264 you will get feedback about the action not being successful too).

@jasonvarga jasonvarga merged commit 1a1aa56 into 5.x Sep 23, 2024
18 checks passed
@jasonvarga jasonvarga deleted the toasts-in-actions branch September 23, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant