r59220 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59219‎ | r59220 | r59221 >
Date:21:41, 18 November 2009
Author:werdna
Status:deferred
Tags:
Comment:
Merge r59218
Modified paths:
  • /branches/wmf-deployment/extensions/LiquidThreads (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads/classes/Thread.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/extensions/LiquidThreads/classes/Thread.php
@@ -475,7 +475,7 @@
476476 // Load a list of threads in bulk, including all subthreads.
477477 static function bulkLoad( $rows ) {
478478 // Preload subthreads
479 - $thread_ids = array();
 479+ $top_thread_ids = array();
480480 $all_thread_rows = $rows;
481481 $pageIds = array();
482482 $linkBatch = new LinkBatch();
@@ -488,7 +488,11 @@
489489 // Build a list of threads for which to pull replies, and page IDs to pull data for.
490490 // Also, pre-initialise the reply cache.
491491 foreach ( $rows as $row ) {
492 - $thread_ids[] = $row->thread_id;
 492+ if ( $row->thread_ancestor ) {
 493+ $top_thread_ids[] = $row->thread_ancestor;
 494+ } else {
 495+ $top_thread_ids[] = $row->thread_id;
 496+ }
493497
494498 // Grab page data while we're here.
495499 if ( $row->thread_root )
@@ -503,10 +507,10 @@
504508
505509 // Pull replies to the threads provided, and as above, pull page IDs to pull data for,
506510 // pre-initialise the reply cache, and stash the row object for later use.
507 - if ( count( $thread_ids ) ) {
 511+ if ( count( $top_thread_ids ) ) {
508512 $dbr = wfGetDB( DB_SLAVE );
509513 $res = $dbr->select( 'thread', '*',
510 - array( 'thread_ancestor' => $thread_ids,
 514+ array( 'thread_ancestor' => $top_thread_ids,
511515 'thread_type != ' . $dbr->addQuotes( Threads::TYPE_DELETED ) ),
512516 __METHOD__ );
513517
Property changes on: branches/wmf-deployment/extensions/LiquidThreads
___________________________________________________________________
Name: svn:mergeinfo
514518 - /branches/REL1_15/phase3/extensions/LiquidThreads:51646
/branches/wmf-deployment/extensions/LiquidThreads_alpha:58990-59125,59188-59189
/trunk/extensions/LiquidThreads:56151-59134,59169,59181-59188
/trunk/phase3/extensions/LiquidThreads:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816
515519 + /branches/REL1_15/phase3/extensions/LiquidThreads:51646
/branches/wmf-deployment/extensions/LiquidThreads_alpha:58990-59125,59188-59189
/trunk/extensions/LiquidThreads:56151-59134,59169,59181-59188,59218
/trunk/phase3/extensions/LiquidThreads:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r59218LiquidThreads: fix bug in bulk loading whereby replies would not be properly ...werdna21:18, 18 November 2009

Status & tagging log