From: Brion Vibber Date: Tue, 20 Dec 2011 21:20:50 +0000 (+0000) Subject: Revert r106523: abstraction violation, looks very wrong, unclear benefits X-Git-Tag: 1.31.0-rc.0~25856 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24ze_article%22%29%20.%20%22?a=commitdiff_plain;h=20e322abf536e294b10ab2705bafbe963be5435d;p=lhc%2Fweb%2Fwiklou.git Revert r106523: abstraction violation, looks very wrong, unclear benefits --- 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(); }