Changeset 1801

Show
Ignore:
Timestamp:
04/08/08 07:44:21 (8 months ago)
Author:
takayama
Message:

Fixed BugId:72519
* Applied Ogawa-san's patch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-34/lib/MT/CMS/Entry.pm

    r1778 r1801  
    23092309            $app->translate( "Permission denied: [_1]", $app->errstr() ) ); 
    23102310 
     2311        # Remove Individual archive file. 
     2312        if ( $app->config('DeleteFilesAtRebuild') ) { 
     2313            $app->publisher->remove_entry_archive_file( Entry => $obj, ); 
     2314        } 
    23112315        if (   $app->config('RebuildAtDelete') 
    23122316            || $app->config('DeleteFilesAtRebuild') ) 
    23132317        { 
    2314             # Remove Induvidual archive file. 
    2315             if ( $app->config('DeleteFilesAtRebuild') ) { 
    2316                 $app->publisher->remove_entry_archive_file( Entry => $obj, ); 
    2317             } 
    2318  
    23192318            for my $at (@at) { 
    23202319                my $archiver = $app->publisher->archiver($at); 
     
    23222321 
    23232322                # Remove archive file if archive file has not entries. 
    2324                 my $deleted = 0; 
    2325                 if ( $app->config('DeleteFilesAtRebuild') ) { 
    2326                     my $count = 
    2327                         $archiver->can('archive_entries_count') 
    2328                       ? $archiver->archive_entries_count( $blog, $at, $obj ) 
    2329                       : 0; 
    2330                     if ( $count == 1 ) { 
    2331                         $app->publisher->remove_entry_archive_file( 
    2332                             Entry       => $obj, 
    2333                             ArchiveType => $at 
    2334                         ); 
    2335                         $deleted = 1; 
    2336                     } 
     2323                my $to_delete = 
     2324                    ( $archiver->archive_entries_count( $blog, $at, $obj ) == 1 ) ? 1 : 0 
     2325                    if $archiver->can('archive_entries_count'); 
     2326                if ( $to_delete && $app->config('DeleteFilesAtRebuild') ) { 
     2327                     $app->publisher->remove_entry_archive_file( 
     2328                         Entry       => $obj, 
     2329                         ArchiveType => $at 
     2330                     ); 
    23372331                } 
     2332                next if $to_delete; 
    23382333 
    23392334                # Make rebuild recip 
    2340                 if ( $app->config('DeleteFilesAtRebuild') ) { 
    2341                     next if $deleted; 
    2342  
     2335                if ( $app->config('RebuildAtDelete') ) { 
    23432336                    my ( $start, $end ) = $archiver->date_range( $obj->authored_on ) 
    23442337                        if $archiver->date_based() && $archiver->can('date_range');