* (bug 15737) Fix notices while expanding using PPCustomFrame
* (bug 15544) Non-index entry points cause the "Wiki not set up" message to
have corrupt URLs
+* (bug 5101) Image from Commons doesn't show up when searched in Wikipedia search box
=== API changes in 1.14 ===
*/
class SearchResult {
var $mRevision = null;
+ var $mImage = null;
function SearchResult( $row ) {
$this->mTitle = Title::makeTitle( $row->page_namespace, $row->page_title );
- if( !is_null($this->mTitle) )
+ if( !is_null($this->mTitle) ){
$this->mRevision = Revision::newFromTitle( $this->mTitle );
+ if($this->mTitle->getNamespace() == NS_IMAGE)
+ $this->mImage = wfFindFile( $this->mTitle );
+ }
}
/**
* @access public
*/
function isMissingRevision(){
- if( !$this->mRevision )
- return true;
- return false;
+ return !$this->mRevision && !$this->mImage;
}
/**
*/
protected function initText(){
if( !isset($this->mText) ){
- $this->mText = $this->mRevision->getText();
+ if($this->mRevision != null)
+ $this->mText = $this->mRevision->getText();
+ else // TODO: can we fetch raw wikitext for commons images?
+ $this->mText = '';
+
}
}
* @return string timestamp
*/
function getTimestamp(){
- return $this->mRevision->getTimestamp();
+ if( $this->mRevision )
+ return $this->mRevision->getTimestamp();
+ else if( $this->mImage )
+ return $this->mImage->getTimestamp();
+ return '';
}
/**