Index: trunk/extensions/LiquidThreads/migrateDatabase.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | 'thread_modified' => 'split-timestamps.sql', |
19 | 19 | 'thread_created' => 'split-timestamps.sql', |
20 | 20 | 'thread_editedness' => 'store-editedness.sql', |
21 | | - 'thread_subject' => 'lqt-schema-change-thread_summary.sql', |
| 21 | + 'thread_subject' => 'store_subject-author.sql', |
22 | 22 | 'thread_author_id' => 'store_subject-author.sql', |
23 | 23 | 'thread_author_name' => 'store_subject-author.sql', |
24 | 24 | ); |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | 'lqt-update-script', array( 'LIMIT' => 500, 'FOR UPDATE', |
51 | 51 | 'ORDER BY' => 'thread_id asc' ) ); |
52 | 52 | |
53 | | - $threads = Threads::loadFromResult( $res ); |
| 53 | + $threads = Threads::loadFromResult( $res, $db ); |
54 | 54 | |
55 | 55 | foreach( $threads as $thread ) { |
56 | 56 | $thread->doLazyUpdates(); |
Index: trunk/extensions/LiquidThreads/classes/LqtThread.php |
— | — | @@ -190,8 +190,7 @@ |
191 | 191 | if ($this->authorId) { |
192 | 192 | return User::newFromId( $this->authorId ); |
193 | 193 | } else { |
194 | | - $u = new User; |
195 | | - $u->mName = $this->authorName; |
| 194 | + $u = User::newFromName( $this->authorName ); |
196 | 195 | |
197 | 196 | return $u; |
198 | 197 | } |
— | — | @@ -449,14 +448,18 @@ |
450 | 449 | //If the page is non-LiquidThreads and it's in subject-space, we'll assume it's meant |
451 | 450 | // to be on the corresponding talk page, but only if the talk-page is a LQT page. |
452 | 451 | //(Previous versions stored the subject page, for some totally bizarre reason) |
| 452 | + // Old versions also sometimes store the thread page for trace threads as the |
| 453 | + // article, not as the root. |
| 454 | + // Trying not to exacerbate this by moving it to be the 'Thread talk' page. |
453 | 455 | $articleTitle = $this->article()->getTitle(); |
454 | 456 | if ( !LqtDispatch::isLqtPage( $articleTitle ) && !$articleTitle->isTalkPage() && |
455 | | - LqtDispatch::isLqtPage( $articleTitle->getTalkPage() ) ) { |
| 457 | + LqtDispatch::isLqtPage( $articleTitle->getTalkPage() ) && |
| 458 | + $articleTitle->getNamespace() != NS_THREAD ) { |
456 | 459 | $newTitle = $articleTitle->getTalkPage(); |
457 | 460 | $newArticle = new Article( $newTitle ); |
458 | 461 | |
459 | 462 | $set['thread_article_namespace'] = $newTitle->getNamespace(); |
460 | | - $set['thread_article_title'] = $newTitle->getTitle(); |
| 463 | + $set['thread_article_title'] = $newTitle->getDbKey(); |
461 | 464 | |
462 | 465 | $this->articleNamespace = $newTitle->getNamespace(); |
463 | 466 | $this->articleTitle = $newTitle->getDbKey(); |