Umherirrender has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/89226


Change subject: Clean up old title on move before reset article id
......................................................................

Clean up old title on move before reset article id

Calling WikiPage::onArticleDelete without a page_id will reload the
page id, maybe from a (lagged) slave, than the title has the page id
set, and a call to Title::exists return true, which shows the link in
blue and the wrong message.

Bug: 45348
Change-Id: If415dc1729b0bb1cfe7fc75f9e29638a6797d478
---
M includes/Title.php
1 file changed, 8 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/26/89226/1

diff --git a/includes/Title.php b/includes/Title.php
index 56e9b44..0d11821 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -3903,7 +3903,12 @@
                        __METHOD__
                );
 
-               $this->resetArticleID( 0 );
+               // clean up the old title before reset article id - bug 45348
+               if ( !$redirectContent ) {
+                       WikiPage::onArticleDelete( $this );
+               }
+
+               $this->resetArticleID( 0 ); // 0 == non existing
                $nt->resetArticleID( $oldid );
                $newpage->loadPageData( WikiPage::READ_LOCKING ); // bug 46397
 
@@ -3919,13 +3924,12 @@
                }
 
                # Recreate the redirect, this time in the other direction.
-               if ( !$redirectContent ) {
-                       WikiPage::onArticleDelete( $this );
-               } else {
+               if ( $redirectContent ) {
                        $redirectArticle = WikiPage::factory( $this );
                        $redirectArticle->loadFromRow( false, 
WikiPage::READ_LOCKING ); // bug 46397
                        $newid = $redirectArticle->insertOn( $dbw );
                        if ( $newid ) { // sanity
+                               $this->resetArticleID( $newid );
                                $redirectRevision = new Revision( array(
                                        'title' => $this, // for determining 
the default content model
                                        'page' => $newid,

-- 
To view, visit https://gerrit.wikimedia.org/r/89226
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If415dc1729b0bb1cfe7fc75f9e29638a6797d478
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to