Skip to content

Commit

Permalink
[#218 state:resolved] Assigned MT::Entry->comment_count to variable a…
Browse files Browse the repository at this point in the history
…nd assign it 0 if undefined or an empty string to suppress this warning.[C
  • Loading branch information
tima committed Dec 9, 2009
1 parent 4324c8e commit 32a137d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/MT/Entry.pm
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,14 @@ MT::Comment->add_callback( 'post_save', 0, MT->component('core'),
visible => 1,
}
);
return unless ( $entry->comment_count != $count );
# tim@appnel.com: It seems that $entry->comment_count will return undefined or
# some non-numeric value causing a warning to be emitted. This method comes
# from MT::Summarizable via MT::Summary. There is not one shred of docs on
# these classes and I don't have the patience to figure out the root cause and
# have inserted the code to use 0 if undefined or blank.
# return unless ( $entry->comment_count != $count );
my $entry_comment_count = $entry->comment_count() || 0;
return unless $entry_comment_count != $count;
$entry->comment_count($count);
$entry->save;
},
Expand Down

0 comments on commit 32a137d

Please sign in to comment.