From af97e72e760745f2c386268df080cd78fb040290 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Mon, 2 Aug 2021 17:35:25 +0300 Subject: [PATCH] Don't needlessly reset article ID Title::resetArticleID() clears various caches and is meant for when a page was inserted or moved or similar. I can't see any reason that it needs to be called by Title::castFromPageIdentity. Doing so wastes resources and prevents use of the method in unit tests. It is also surprising for a cast to have side effects. Change-Id: I71c523e7406d493c52199c3a5a9ca7cd414bb5eb --- includes/Title.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Title.php b/includes/Title.php index 0eb4334eb95..c8b6763629f 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -387,7 +387,7 @@ class Title implements LinkTarget, PageIdentity, IDBAccessObject { $title = self::makeTitle( $pageReference->getNamespace(), $pageReference->getDBkey() ); if ( $pageReference instanceof PageIdentity ) { - $title->resetArticleID( $pageReference->getId() ); + $title->mArticleID = $pageReference->getId(); } return $title; }