http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89574

Revision: 89574
Author:   reedy
Date:     2011-06-06 15:58:55 +0000 (Mon, 06 Jun 2011)
Log Message:
-----------
Fix fixme on r89549

Modified Paths:
--------------
    trunk/phase3/includes/api/ApiPageSet.php

Modified: trunk/phase3/includes/api/ApiPageSet.php
===================================================================
--- trunk/phase3/includes/api/ApiPageSet.php    2011-06-06 15:54:42 UTC (rev 
89573)
+++ trunk/phase3/includes/api/ApiPageSet.php    2011-06-06 15:58:55 UTC (rev 
89574)
@@ -451,6 +451,7 @@
 
                $pageids = self::getPositiveIntegers( $pageids );
 
+               $res = null;
                if ( count( $pageids ) ) {
                        $set = array(
                                'page_id' => $pageids
@@ -485,20 +486,22 @@
                        ApiBase::dieDebug( __METHOD__, 'Missing $processTitles 
parameter when $remaining is provided' );
                }
 
-               foreach ( $res as $row ) {
-                       $pageId = intval( $row->page_id );
+               if ( $res ) {
+                       foreach ( $res as $row ) {
+                               $pageId = intval( $row->page_id );
 
-                       // Remove found page from the list of remaining items
-                       if ( isset( $remaining ) ) {
-                               if ( $processTitles ) {
-                                       unset( 
$remaining[$row->page_namespace][$row->page_title] );
-                               } else {
-                                       unset( $remaining[$pageId] );
+                               // Remove found page from the list of remaining 
items
+                               if ( isset( $remaining ) ) {
+                                       if ( $processTitles ) {
+                                               unset( 
$remaining[$row->page_namespace][$row->page_title] );
+                                       } else {
+                                               unset( $remaining[$pageId] );
+                                       }
                                }
+
+                               // Store any extra fields requested by modules
+                               $this->processDbRow( $row );
                        }
-
-                       // Store any extra fields requested by modules
-                       $this->processDbRow( $row );
                }
 
                if ( isset( $remaining ) ) {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to