Changeset 1920

Show
Ignore:
Timestamp:
04/16/08 01:07:31 (3 months ago)
Author:
auno
Message:

Need more condition to decrease the count when comments or trackbacks are deleted. BugzID:79271

Files:

Legend:

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

    r1856 r1920  
    364364        my $entry   = MT::Entry->load( $comment->entry_id ) 
    365365            or return; 
    366         $entry->comment_count( $entry->comment_count - 1 ); 
    367         $entry->save; 
     366        if ($comment->visible) { 
     367            $entry->comment_count( $entry->comment_count - 1 ); 
     368            $entry->save; 
     369        } 
    368370    } 
    369371); 
     
    409411        require MT::Trackback; 
    410412        if ( my $tb = MT::Trackback->load( $ping->tb_id ) ) { 
    411             if ( $tb->entry_id ) { 
     413            if ( $tb->entry_id && $ping->visible ) { 
    412414                my $entry = MT::Entry->load( $tb->entry_id ) 
    413415                    or return;