IAlex has uploaded a new change for review.

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


Change subject: (bug 45417) Remove resetArticleID() call from 
RecentChanges::getTitle()
......................................................................

(bug 45417) Remove resetArticleID() call from RecentChanges::getTitle()

This is doing more harm than good; see I489c406f (4769f44) for a similar issue.

The problem is that if resetArticleID() get called with a strictly positive 
value
when the page does not exist, getArticleID() will return that value indicating 
that
the page exists, but the LinkCache will return null for complementary fields, 
causing
the exception mentionned in the bug.
By removing the resetArticleID() call, the ID will get loaded from the 
LinkCache, and
thus the whole Title object is in a consistent state.
Since a LinkBatch is already executed for those titles from 
Special:Recentchanges and
Special:Watchlist, this will not increase the number of database queries for 
those
special pages (and even lowers it from what I saw on my development wiki).

Change-Id: I8742cce46908ce8eb3fee55c1b6e458732b1ebd7
---
M includes/RecentChange.php
1 file changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/10/50910/1

diff --git a/includes/RecentChange.php b/includes/RecentChange.php
index f63e95c..6af7597 100644
--- a/includes/RecentChange.php
+++ b/includes/RecentChange.php
@@ -191,8 +191,6 @@
        public function &getTitle() {
                if ( $this->mTitle === false ) {
                        $this->mTitle = Title::makeTitle( 
$this->mAttribs['rc_namespace'], $this->mAttribs['rc_title'] );
-                       # Make sure the correct page ID is process cached
-                       $this->mTitle->resetArticleID( 
$this->mAttribs['rc_cur_id'] );
                }
                return $this->mTitle;
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8742cce46908ce8eb3fee55c1b6e458732b1ebd7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex <ialex.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to