From dc579d27da7b86ff46dc972eb54ea31cba561c26 Mon Sep 17 00:00:00 2001 From: Matthew Flaschen Date: Tue, 17 May 2016 10:18:58 -0400 Subject: [PATCH] Title->getContentModel: Get new content model with GAID_FOR_UPDATE If a new revision has been inserted (e.g. with updateRevisionOn), the content model may have changed. This happens with e.g. undeletion. Bug: T122262 Change-Id: Ia0ed86a9c24809256215418673e9ee8e263d1349 --- includes/Title.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/Title.php b/includes/Title.php index 25fbce3f57..72c21fc337 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -908,7 +908,9 @@ class Title implements LinkTarget { * @return string Content model id */ public function getContentModel( $flags = 0 ) { - if ( !$this->mContentModel && $this->getArticleID( $flags ) ) { + if ( ( !$this->mContentModel || $flags === Title::GAID_FOR_UPDATE ) && + $this->getArticleID( $flags ) + ) { $linkCache = LinkCache::singleton(); $linkCache->addLinkObj( $this ); # in case we already had an article ID $this->mContentModel = $linkCache->getGoodLinkFieldObj( $this, 'model' ); -- 2.20.1