Permalink
Browse files

Big bugfix - this allows users to post to discussions that don't already

have any comments.  The bug was that the menu data and "Reply" button
were disabled so there was no (obvious) way to start the first comment.
Oops.
  • Loading branch information...
1 parent 3f18084 commit 922169d6e07d3a1840a5c8119b88be6ed99ef479 @jamiemccarthy jamiemccarthy committed Jun 20, 2002
Showing with 8 additions and 10 deletions.
  1. +8 −10 Slash/Slash.pm
View
@@ -92,12 +92,7 @@ sub selectComments {
$cid,
$cache_read_only
);
- # i don't know why this line had || !@$thisComment, but it
- # breaks things (most notably, things relying on hitparade,
- # like slash:hitparade in rss, selectThreshold in comments,
- # etc.) when there are no comments YET, but the discussion
- # is valid -- pudge
- if (!$thisComment) { #|| !@$thisComment) {
+ if (!$thisComment) {
_print_cchp($header);
return ( {}, 0 );
}
@@ -191,6 +186,8 @@ sub selectComments {
# Cascade comment point totals down to the lowest score, so
# (2, 1, 3, 5, 4, 2, 1) becomes (18, 16, 15, 12, 7, 3, 1).
+ # We do a bit of a weird thing here, returning this data in
+ # the fields for a fake comment with "cid 0"...
for my $x (reverse(0..$num_scores-2)) {
$comments->{0}{totals}[$x] += $comments->{0}{totals}[$x + 1];
}
@@ -262,7 +259,7 @@ sub reparentComments {
# You know, we do assume comments are linear -Brian
for my $x (sort { $a <=> $b } keys %$comments) {
- next if $x == 0;
+ next if $x == 0; # exclude the fake "cid 0" comment
my $pid = $comments->{$x}{pid};
my $reparent;
@@ -417,9 +414,10 @@ sub printComments {
# Should I index or just display normally?
my $cc = 0;
- if ($comments->{$cidorpid} && $comments->{$cidorpid}{visiblekids}) {
- $cc = $comments->{$cidorpid}{visiblekids};
- }
+ $cc = $comments->{$cidorpid}{visiblekids}
+ if $cidorpid
+ && $comments->{$cidorpid}
+ && $comments->{$cidorpid}{visiblekids};
$lvl++ if $user->{mode} ne 'flat' && $user->{mode} ne 'archive'
&& $cc > $user->{commentspill}

0 comments on commit 922169d

Please sign in to comment.