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] Prevent published toast when save failed #10263

Conversation

simonerd
Copy link
Contributor

@simonerd simonerd commented Jun 5, 2024

fixes #10190
replaces #10191

I've tried to stay as close as possible to the changes made in #9040 but needed some further adjustments. Specifically, Revisable::publishWorkingCopy() and Revisable::unpublishWorkingCopy() now return false if the entry save() function fails. While this seems reasonable to me, I haven't yet found out if there are any other places (apart from the PublishedEntriesController) that would need to be considered.

I have added translations for the "Couldn't (un)publish entry" toast message as far as my (non-german) language skills felt reliable enough.

Copy link
Member

@duncanmcclean duncanmcclean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

I've made a couple of changes to ensure the publish form values don't get updated when failing saves.

@jasonvarga jasonvarga merged commit 302c69d into statamic:5.x Aug 12, 2024
16 checks passed
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.

'Published' toast is shown when returning false from EntrySaving listener
3 participants