r78805 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78804‎ | r78805 | r78806 >
Date:16:20, 22 December 2010
Author:reedy
Status:ok
Tags:
Comment:
Show images that don't exist, as they are included in the count
Modified paths:
  • /trunk/phase3/includes/ImageQueryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImageQueryPage.php
@@ -28,16 +28,17 @@
2929 # $res might contain the whole 1,000 rows, so we read up to
3030 # $num [should update this to use a Pager]
3131 for( $i = 0; $i < $num && $row = $dbr->fetchObject( $res ); $i++ ) {
32 - $image = $this->prepareImage( $row );
33 - if( $image ) {
34 - $gallery->add( $image->getTitle(), $this->getCellHtml( $row ) );
 32+ $namespace = isset( $row->namespace ) ? $row->namespace : NS_FILE;
 33+ $title = Title::makeTitleSafe( $namespace, $row->title );
 34+ if ( $title instanceof Title && $title->getNamespace() == NS_FILE ) {
 35+ $gallery->add( $title, $this->getCellHtml( $row ) );
3536 }
3637 }
3738
3839 $out->addHTML( $gallery->toHtml() );
3940 }
4041 }
41 -
 42+
4243 // Gotta override this since it's abstract
4344 function formatResult( $skin, $result ) { }
4445

Follow-up revisions

RevisionCommit summaryAuthorDate
r78807Followup r78805, remove now unused functionreedy16:28, 22 December 2010

Status & tagging log