r53170 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53169‎ | r53170 | r53171 >
Date:15:26, 13 July 2009
Author:werdna
Status:deferred
Tags:
Comment:
General LiquidThreads fixes:
* Fix loading of anonymous users in Thread::author(), was giving the current IP for all IP users.
* Fix update script, missing parameter (has now been tested. Apart from some weird database corruption I can't do anything about because it's in a previous version, now seems to work).
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/LqtThread.php (modified) (history)
  • /trunk/extensions/LiquidThreads/migrateDatabase.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/migrateDatabase.php
@@ -17,7 +17,7 @@
1818 'thread_modified' => 'split-timestamps.sql',
1919 'thread_created' => 'split-timestamps.sql',
2020 'thread_editedness' => 'store-editedness.sql',
21 - 'thread_subject' => 'lqt-schema-change-thread_summary.sql',
 21+ 'thread_subject' => 'store_subject-author.sql',
2222 'thread_author_id' => 'store_subject-author.sql',
2323 'thread_author_name' => 'store_subject-author.sql',
2424 );
@@ -49,7 +49,7 @@
5050 'lqt-update-script', array( 'LIMIT' => 500, 'FOR UPDATE',
5151 'ORDER BY' => 'thread_id asc' ) );
5252
53 - $threads = Threads::loadFromResult( $res );
 53+ $threads = Threads::loadFromResult( $res, $db );
5454
5555 foreach( $threads as $thread ) {
5656 $thread->doLazyUpdates();
Index: trunk/extensions/LiquidThreads/classes/LqtThread.php
@@ -190,8 +190,7 @@
191191 if ($this->authorId) {
192192 return User::newFromId( $this->authorId );
193193 } else {
194 - $u = new User;
195 - $u->mName = $this->authorName;
 194+ $u = User::newFromName( $this->authorName );
196195
197196 return $u;
198197 }
@@ -449,14 +448,18 @@
450449 //If the page is non-LiquidThreads and it's in subject-space, we'll assume it's meant
451450 // to be on the corresponding talk page, but only if the talk-page is a LQT page.
452451 //(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.
453455 $articleTitle = $this->article()->getTitle();
454456 if ( !LqtDispatch::isLqtPage( $articleTitle ) && !$articleTitle->isTalkPage() &&
455 - LqtDispatch::isLqtPage( $articleTitle->getTalkPage() ) ) {
 457+ LqtDispatch::isLqtPage( $articleTitle->getTalkPage() ) &&
 458+ $articleTitle->getNamespace() != NS_THREAD ) {
456459 $newTitle = $articleTitle->getTalkPage();
457460 $newArticle = new Article( $newTitle );
458461
459462 $set['thread_article_namespace'] = $newTitle->getNamespace();
460 - $set['thread_article_title'] = $newTitle->getTitle();
 463+ $set['thread_article_title'] = $newTitle->getDbKey();
461464
462465 $this->articleNamespace = $newTitle->getNamespace();
463466 $this->articleTitle = $newTitle->getDbKey();

Status & tagging log