From b21dfac678f4fc8417cbcc74921492a3403b6e83 Mon Sep 17 00:00:00 2001 From: "Jack D. Pond" Date: Mon, 26 Apr 2010 14:44:54 +0000 Subject: [PATCH] Modification to LocalFile::getHistory for custom repos Hard coded OldLocalFile::getHistory now used only when oldFileFromRowFactory not declared - for backwards compatibility --- includes/filerepo/LocalFile.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index d7364a537c..c321d9124d 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -661,7 +661,11 @@ class LocalFile extends File { $res = $dbr->select( $tables, $fields, $conds, __METHOD__, $opts, $join_conds ); $r = array(); while( $row = $dbr->fetchObject( $res ) ) { - $r[] = OldLocalFile::newFromRow( $row, $this->repo ); + if ( $this->repo->oldFileFromRowFactory ) { + $r[] = call_user_func( $this->repo->oldFileFromRowFactory, $row, $this->repo ); + } else { + $r[] = OldLocalFile::newFromRow( $row, $this->repo ); + } } if( $order == 'ASC' ) { $r = array_reverse( $r ); // make sure it ends up descending -- 2.20.1