noreply at github
Aug 16, 2011, 12:15 AM
[bricoleurs/bricolage] ca5f60: Fix handling of publish failures in Ajax publish r...
Author: David E. Wheeler <david [at] justatheory>
Date: 2011-08-16 (Tue, 16 Aug 2011)
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.