From: Sam Reed Date: Wed, 22 Dec 2010 16:20:16 +0000 (+0000) Subject: Show images that don't exist, as they are included in the count X-Git-Tag: 1.31.0-rc.0~33183 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=5879bce6b4faaf19f771e8d094c9789f65003919;p=lhc%2Fweb%2Fwiklou.git Show images that don't exist, as they are included in the count --- diff --git a/includes/ImageQueryPage.php b/includes/ImageQueryPage.php index c50b0cc516..c2ecfd33a4 100644 --- a/includes/ImageQueryPage.php +++ b/includes/ImageQueryPage.php @@ -28,16 +28,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++ ) { - $image = $this->prepareImage( $row ); - if( $image ) { - $gallery->add( $image->getTitle(), $this->getCellHtml( $row ) ); + $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 ) ); } } $out->addHTML( $gallery->toHtml() ); } } - + // Gotta override this since it's abstract function formatResult( $skin, $result ) { }