Skip to content

[6.x] Report failed actions as failures - #15950

Merged
duncanmcclean merged 1 commit into
statamic:6.xfrom
jacksleight:fix/failed-action-feedback
Nov 17, 2026
Merged

duncanmcclean merged 1 commit into
statamic:6.xfrom
jacksleight:fix/failed-action-feedback

Conversation

@jacksleight

Copy link
Copy Markdown
Contributor

When an action fails (eg. an EntryDeleting listener returns false or throws an exception) the CP reports it as a success:

  • On the edit form the action's redirect is still returned, so you're sent back to the listing with an "Action completed" toast while the entry still exists.
  • In listings the failure message is shown as a success toast, as RowActions and BulkActions don't check success in the response (the v5 listing did).

This PR fixes it by only returning an action's redirect or download when it succeeds, and by checking success wherever action responses are handled.

Notes

  • After a failed delete on the edit form, the form's values are refreshed from the server the same as any other failed action, so unsaved changes are lost. Previously you were redirected away, so they were lost anyway.
  • The collection tree view has the same problem, but deletes there happen when the tree is saved, in CollectionTreeController::deleteEntries(). That ignores a cancelled delete and still reports "Saved", and on multisite it deletes or detaches the entry's localisations before the delete is cancelled. That's more complicated so probably needs its own PR.

@duncanmcclean
duncanmcclean merged commit 5550ef2 into statamic:6.x Nov 17, 2026
62 checks passed
@duncanmcclean

Copy link
Copy Markdown
Member

Thanks!

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.

2 participants