Please sign in to comment.
Fix handling of publish failures in Ajax publish requests.
This fixes the half of bug #277, when one attempts to publish from a desk or workspace. When `PUBLISH_RELATED_FAIL_BEHAVIOR = fail` and a related asset fails to publish, we now call `raise_conflict` to return a 409 and do a better job displaying *all* the appropriate error messages. When `PUBLISH_RELATED_FAIL_BEHAVIOR = warn` and related asset fails to publish, we call a new moethod, `show_accepted()`. This method returns a 202 status code, which I'm abusing a bit here, but it comes closest to what we want. The story properly publishes and disappears from the desk, but a new handler in the Ajax code also shows the errors when related failed to publish. I also added code to abort at the end of the Desk `publish` callback when a request is Ajax so that no other stuff gets sent back to the browser. This is because in "warn" mode, we wnt the full request to succeed, with no rollbacks or anything, and all subsequent code should execute, so that the story will properly be published and removed from workflow. Tomorrow I'll have to figure out what to do about non-ajax publish requests in order to properly and finally fix bug # 277.
- Loading branch information...
Showing with 46 additions and 24 deletions.