* (bug 25987) prop=info&inprop=watched now also works for missing pages
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 19 Nov 2010 10:53:08 +0000 (10:53 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 19 Nov 2010 10:53:08 +0000 (10:53 +0000)
RELEASE-NOTES
includes/api/ApiQueryInfo.php

index 1701831..27911d5 100644 (file)
@@ -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 ===
 
index 6434147..8ffb2e2 100644 (file)
@@ -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;
                }
        }