From 00226e1e9b7f416ab4a6f54b9e5d2c985e889c10 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 19 Nov 2010 10:53:08 +0000 Subject: [PATCH] * (bug 25987) prop=info&inprop=watched now also works for missing pages --- RELEASE-NOTES | 1 + includes/api/ApiQueryInfo.php | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 17018314a0..27911d5406 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -522,6 +522,7 @@ LocalSettings.php. The specific bugs are listed below in the general notes. * (bug 25741) Add more data to list=search's srprop * (bug 25760) counter property still reported by the API when $wgDisableCounters enabled +* (bug 25987) prop=info&inprop=watched now also works for missing pages === Languages updated in 1.17 === diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 64341473a9..8ffb2e22b8 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -593,29 +593,27 @@ class ApiQueryInfo extends ApiQueryBase { private function getWatchedInfo() { global $wgUser; - if ( $wgUser->isAnon() || count( $this->titles ) == 0 ) { + if ( $wgUser->isAnon() || count( $this->everything ) == 0 ) { return; } $this->watched = array(); $db = $this->getDB(); - $lb = new LinkBatch( $this->titles ); + $lb = new LinkBatch( $this->everything ); $this->resetQueryParams(); - $this->addTables( array( 'page', 'watchlist' ) ); - $this->addFields( array( 'page_title', 'page_namespace' ) ); + $this->addTables( array( 'watchlist' ) ); + $this->addFields( array( 'wl_title', 'wl_namespace' ) ); $this->addWhere( array( - $lb->constructSet( 'page', $db ), - 'wl_namespace=page_namespace', - 'wl_title=page_title', + $lb->constructSet( 'wl', $db ), 'wl_user' => $wgUser->getID() ) ); $res = $this->select( __METHOD__ ); foreach ( $res as $row ) { - $this->watched[$row->page_namespace][$row->page_title] = true; + $this->watched[$row->wl_namespace][$row->wl_title] = true; } } -- 2.20.1