Index: branches/wmf-deployment/extensions/LiquidThreads/classes/Thread.php |
— | — | @@ -475,7 +475,7 @@ |
476 | 476 | // Load a list of threads in bulk, including all subthreads. |
477 | 477 | static function bulkLoad( $rows ) { |
478 | 478 | // Preload subthreads |
479 | | - $thread_ids = array(); |
| 479 | + $top_thread_ids = array(); |
480 | 480 | $all_thread_rows = $rows; |
481 | 481 | $pageIds = array(); |
482 | 482 | $linkBatch = new LinkBatch(); |
— | — | @@ -488,7 +488,11 @@ |
489 | 489 | // Build a list of threads for which to pull replies, and page IDs to pull data for. |
490 | 490 | // Also, pre-initialise the reply cache. |
491 | 491 | 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 | + } |
493 | 497 | |
494 | 498 | // Grab page data while we're here. |
495 | 499 | if ( $row->thread_root ) |
— | — | @@ -503,10 +507,10 @@ |
504 | 508 | |
505 | 509 | // Pull replies to the threads provided, and as above, pull page IDs to pull data for, |
506 | 510 | // pre-initialise the reply cache, and stash the row object for later use. |
507 | | - if ( count( $thread_ids ) ) { |
| 511 | + if ( count( $top_thread_ids ) ) { |
508 | 512 | $dbr = wfGetDB( DB_SLAVE ); |
509 | 513 | $res = $dbr->select( 'thread', '*', |
510 | | - array( 'thread_ancestor' => $thread_ids, |
| 514 | + array( 'thread_ancestor' => $top_thread_ids, |
511 | 515 | 'thread_type != ' . $dbr->addQuotes( Threads::TYPE_DELETED ) ), |
512 | 516 | __METHOD__ ); |
513 | 517 | |
Property changes on: branches/wmf-deployment/extensions/LiquidThreads |
___________________________________________________________________ |
Name: svn:mergeinfo |
514 | 518 | - /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 |
515 | 519 | + /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 |