Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fold $is_ajax into $allow_fail to simplify things.

  • Loading branch information...
commit 7bba7a7902b7c26c445ba5ff0259a80c40caecf7 1 parent 4ee39a0
@theory theory authored committed
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/Bric/App/Callback/Desk.pm
View
5 lib/Bric/App/Callback/Desk.pm
@@ -223,6 +223,7 @@ sub publish : Callback {
my $r = $self->apache_req;
$r && ($r->headers_in->{'X-Requested-With'} || '') eq 'XMLHttpRequest';
};
+ $allow_fatal ||= !$is_ajax;
# If we were passed a string instead of an object, find the object
for my $pub (\$story_pub, \$media_pub) {
@@ -384,7 +385,7 @@ sub publish : Callback {
throw_error(
error => $err,
maketext => [$err]
- ) if $allow_fatal || !$is_ajax;
+ ) if $allow_fatal;
$self->raise_conflict([$err]);
} else {
# we are set to warn, should we add a further warning to the msg ?
@@ -431,7 +432,7 @@ sub publish : Callback {
# If it was on a desk, we need to revert its workflow status.
$self->_revert_to_original_state;
# Continue with normal error handling.
- die $err if $allow_fatal || !$is_ajax;
+ die $err if $allow_fatal;
$self->raise_conflict($err->maketext);
} else {
# Success! Need to log the move to a desk. Yes, this is late, but
Please sign in to comment.
Something went wrong with that request. Please try again.