Index: trunk/extensions/LiquidThreads/classes/Thread.php |
— | — | @@ -139,12 +139,15 @@ |
140 | 140 | $this->root = null; |
141 | 141 | } |
142 | 142 | |
143 | | - function commitRevision( $change_type, $change_object = null, $reason = "" ) { |
| 143 | + function commitRevision( $change_type, $change_object = null, $reason = "", |
| 144 | + $bump = null ) { |
144 | 145 | $this->dieIfHistorical(); |
145 | 146 | global $wgUser; |
146 | 147 | |
147 | 148 | global $wgThreadActionsNoBump; |
148 | | - $bump = !in_array( $change_type, $wgThreadActionsNoBump ); |
| 149 | + if ( is_null($bump) ) { |
| 150 | + $bump = !in_array( $change_type, $wgThreadActionsNoBump ); |
| 151 | + } |
149 | 152 | if ( $bump ) { |
150 | 153 | $this->sortkey = wfTimestampNow( TS_DB ); |
151 | 154 | } |
— | — | @@ -376,12 +379,17 @@ |
377 | 380 | } |
378 | 381 | |
379 | 382 | function incrementReplyCount( $val = 1 ) { |
380 | | - $thread = $this; |
381 | | - while ( $thread ) { |
382 | | - $thread->replyCount += $val; |
| 383 | + $this->replyCount += $val; |
| 384 | + |
| 385 | + wfDebug( "Incremented reply count for thread ".$this->id()." to ".$this->replyCount."\n" ); |
| 386 | + |
| 387 | + $thread = $this->superthread(); |
| 388 | + |
| 389 | + if ( $thread ) { |
| 390 | + $thread->incrementReplyCount( $val ); |
| 391 | + wfDebug( "Saving Incremented thread ".$thread->id(). |
| 392 | + " with reply count ".$thread->replyCount."\n" ); |
383 | 393 | $thread->save(); |
384 | | - |
385 | | - $thread = $thread->superthread(); |
386 | 394 | } |
387 | 395 | } |
388 | 396 | |