From: Brion Vibber Date: Thu, 29 May 2008 22:45:11 +0000 (+0000) Subject: Hack around borkage with findFiles() on ForeignDBViaLBRepo by copying newFileFromRow... X-Git-Tag: 1.31.0-rc.0~47293 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=51ee20d4ba1a88ca910461cf0a0631e159f34518;p=lhc%2Fweb%2Fwiklou.git Hack around borkage with findFiles() on ForeignDBViaLBRepo by copying newFileFromRow() from ForeignDBRepo. Probably this is all wrong, and both classes should be ripped out a bit and told to use the defined factory functions? --- diff --git a/includes/filerepo/ForeignDBViaLBRepo.php b/includes/filerepo/ForeignDBViaLBRepo.php index ee9d11673d..e464f080b5 100644 --- a/includes/filerepo/ForeignDBViaLBRepo.php +++ b/includes/filerepo/ForeignDBViaLBRepo.php @@ -8,6 +8,12 @@ class ForeignDBViaLBRepo extends LocalRepo { var $wiki, $dbName, $tablePrefix; var $fileFactory = array( 'ForeignDBFile', 'newFromTitle' ); + function newFileFromRow( $row ) { + if ( isset( $row->img_name ) ) + return ForeignDBFile::newFromRow( $row, $this ); + return parent::newFileFromRow( $row ); + } + function __construct( $info ) { parent::__construct( $info ); $this->wiki = $info['wiki'];