Changeset 2575

Show
Ignore:
Timestamp:
06/13/08 23:38:01 (20 months ago)
Author:
bchoate
Message:

Fix for displaying publish error when saving a publishable comment. BugId:80094

Location:
branches/release-40/lib/MT
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/release-40/lib/MT/App/CMS.pm

    r2425 r2575  
    31743174        require MT::Log; 
    31753175        $app->log({ 
    3176             message => $app->translate("Error during publishing: [_1]", (defined $msg ? $msg : $app->errstr)), 
     3176            message => (defined $msg ? $msg : $app->translate("Error during publishing: [_1]", $app->errstr)), 
    31773177            class => "system", 
    31783178            level => MT::Log::ERROR(), 
  • branches/release-40/lib/MT/CMS/Comment.pm

    r2001 r2575  
    14601460    my $eh = shift; 
    14611461    my ( $app, $obj, $original ) = @_; 
     1462 
    14621463    if ( $obj->visible 
    14631464        || ( ( $obj->visible || 0 ) != ( $original->visible || 0 ) ) ) 
    14641465    { 
    1465         $app->rebuild_entry( Entry => $obj->entry_id, BuildIndexes => 1 ) 
    1466             or return $app->publish_error(); 
     1466        return MT::Util::start_background_task( 
     1467            sub { 
     1468                my $app = MT->instance; 
     1469                if ( !$app->rebuild_entry( Entry => $obj->entry_id, BuildIndexes => 1 ) ) { 
     1470                    $app->publish_error(); # logs error as well. 
     1471                    return $eh->error( MT->translate( "Publish failed: [_1]", $app->errstr ) ); 
     1472                } 
     1473            } 
     1474        ); 
    14671475    } 
    14681476    1;