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

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

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • 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;