Call loadFromRow() as needed in Title::moveToInternal.
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 21 Mar 2013 23:06:45 +0000 (16:06 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 21 Mar 2013 23:31:53 +0000 (23:31 +0000)
* Follows up 61c0064de538c3b1ea61470eadd88fab87d3513e,
  which was missing a load call to fully fix the bug.
  Calling loadFromRow() forced the page to load as
  non-existing (which it should be).
* The redirect title was triggering a load from a slave in
  updateRevisionOn() and wrongly updating the destination page
  to point to the redirect revision and leaving the redirect
  page with page_latest=0;

Bug : 46397
Change-Id: Id6abe062a0266a790716df8c592911fd89b83223

includes/Title.php

index 84848eb..bfbb06f 100644 (file)
@@ -3856,6 +3856,7 @@ class Title {
                        WikiPage::onArticleDelete( $this );
                } else {
                        $redirectArticle = WikiPage::factory( $this );
+                       $redirectArticle->loadFromRow( false, WikiPage::READ_LOCKING ); // bug 46397
                        $newid = $redirectArticle->insertOn( $dbw );
                        if ( $newid ) { // sanity
                                $redirectRevision = new Revision( array(