From 20e322abf536e294b10ab2705bafbe963be5435d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 20 Dec 2011 21:20:50 +0000 Subject: [PATCH] Revert r106523: abstraction violation, looks very wrong, unclear benefits --- includes/Title.php | 15 ++++----------- includes/api/ApiQueryBase.php | 6 +----- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 5119426aa0..296328044f 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2774,15 +2774,6 @@ class Title { return $this->mCounter; } - /** - * Returns a bool to say whether the Article ID for this title has already been loaded - * - * @return bool - */ - public function isArticleIDLoaded() { - return $this->mArticleID != -1; - } - /** * Get the article ID for this Title from the link cache, * adding it if necessary @@ -2801,8 +2792,10 @@ class Title { $linkCache->clearLink( $this ); $this->mArticleID = $linkCache->addLinkObj( $this ); $linkCache->forUpdate( $oldUpdate ); - } else if ( -1 == $this->mArticleID ) { - $this->mArticleID = $linkCache->addLinkObj( $this ); + } else { + if ( -1 == $this->mArticleID ) { + $this->mArticleID = $linkCache->addLinkObj( $this ); + } } return $this->mArticleID; } diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index fdaa630abc..e3cf51f50c 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -304,11 +304,7 @@ abstract class ApiQueryBase extends ApiBase { */ public static function addTitleInfo( &$arr, $title, $prefix = '' ) { $arr[$prefix . 'ns'] = intval( $title->getNamespace() ); - // TODO: This is a workaround for bug 28901, as the Article ID isn't always loaded - // Saves many DB queries, but does need cleaning up, so callers have always loaded the Article ID also - if ( $title->isArticleIDLoaded() ) { - $arr[$prefix . 'pageid'] = $title->getArticleID(); - } + $arr[$prefix . 'pageid'] = $title->getArticleID(); $arr[$prefix . 'title'] = $title->getPrefixedText(); } -- 2.20.1