Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 922169d6e07d3a1840a5c8119b88be6ed99ef479 1 parent 3f18084
Jamie McCarthy authored June 20, 2002

Showing 1 changed file with 8 additions and 10 deletions. Show diff stats Hide diff stats

  1. 18  Slash/Slash.pm
18  Slash/Slash.pm
@@ -92,12 +92,7 @@ sub selectComments {
92 92
 		$cid, 
93 93
 		$cache_read_only
94 94
 	);
95  
-	# i don't know why this line had || !@$thisComment, but it
96  
-	# breaks things (most notably, things relying on hitparade,
97  
-	# like slash:hitparade in rss, selectThreshold in comments,
98  
-	# etc.) when there are no comments YET, but the discussion
99  
-	# is valid -- pudge
100  
-	if (!$thisComment) { #|| !@$thisComment) {
  95
+	if (!$thisComment) {
101 96
 		_print_cchp($header);
102 97
 		return ( {}, 0 );
103 98
 	}
@@ -191,6 +186,8 @@ sub selectComments {
191 186
 
192 187
 	# Cascade comment point totals down to the lowest score, so
193 188
 	# (2, 1, 3, 5, 4, 2, 1) becomes (18, 16, 15, 12, 7, 3, 1).
  189
+	# We do a bit of a weird thing here, returning this data in
  190
+	# the fields for a fake comment with "cid 0"...
194 191
 	for my $x (reverse(0..$num_scores-2)) {
195 192
 		$comments->{0}{totals}[$x] += $comments->{0}{totals}[$x + 1];
196 193
 	}
@@ -262,7 +259,7 @@ sub reparentComments {
262 259
 
263 260
 	# You know, we do assume comments are linear -Brian
264 261
 	for my $x (sort { $a <=> $b } keys %$comments) {
265  
-		next if $x == 0;
  262
+		next if $x == 0; # exclude the fake "cid 0" comment
266 263
 
267 264
 		my $pid = $comments->{$x}{pid};
268 265
 		my $reparent;
@@ -417,9 +414,10 @@ sub printComments {
417 414
 
418 415
 	# Should I index or just display normally?
419 416
 	my $cc = 0;
420  
-	if ($comments->{$cidorpid} && $comments->{$cidorpid}{visiblekids}) {
421  
-		$cc = $comments->{$cidorpid}{visiblekids};
422  
-	}
  417
+	$cc = $comments->{$cidorpid}{visiblekids}
  418
+		if $cidorpid
  419
+			&& $comments->{$cidorpid}
  420
+			&& $comments->{$cidorpid}{visiblekids};
423 421
 
424 422
 	$lvl++ if $user->{mode} ne 'flat' && $user->{mode} ne 'archive'
425 423
 		&& $cc > $user->{commentspill}

0 notes on commit 922169d

Please sign in to comment.
Something went wrong with that request. Please try again.