Also set the queue types map when rebuilding the ready queue map
[lhc/web/wiklou.git] / includes / ImageQueryPage.php
index 75f7ba6..b0266cb 100644 (file)
@@ -47,12 +47,17 @@ abstract class ImageQueryPage extends QueryPage {
 
                        # $res might contain the whole 1,000 rows, so we read up to
                        # $num [should update this to use a Pager]
-                       for ( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) {
+                       $i = 0;
+                       foreach ( $res as $row ) {
+                               $i++;
                                $namespace = isset( $row->namespace ) ? $row->namespace : NS_FILE;
                                $title = Title::makeTitleSafe( $namespace, $row->title );
                                if ( $title instanceof Title && $title->getNamespace() == NS_FILE ) {
                                        $gallery->add( $title, $this->getCellHtml( $row ) );
                                }
+                               if ( $i === $num ) {
+                                       break;
+                               }
                        }
 
                        $out->addHTML( $gallery->toHtml() );
@@ -60,7 +65,8 @@ abstract class ImageQueryPage extends QueryPage {
        }
 
        // Gotta override this since it's abstract
-       function formatResult( $skin, $result ) { }
+       function formatResult( $skin, $result ) {
+       }
 
        /**
         * Get additional HTML to be shown in a results' cell