From 09c2fbf75ef0e37e7716f87ce8d89d9ca533e00c Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 13 Mar 2011 23:04:51 +0000 Subject: [PATCH] * (bug 27585) add pagecount to list=filearchive --- RELEASE-NOTES | 3 ++- includes/api/ApiQueryFilearchive.php | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d88b479e7c..f6ea6f1533 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -115,7 +115,7 @@ PHP if you have not done so prior to upgrading MediaWiki. * (bug 2581, bug 6834) Added links to thumbnail in several resolutions to the file description page. The sizes are set by $wgImageLimits. * (bug 28031) Add pageCount support to ArchivedFile - + === Bug fixes in 1.18 === * (bug 23119) WikiError class and subclasses are now marked as deprecated * (bug 10871) Javascript and CSS pages in MediaWiki namespace are no longer @@ -257,6 +257,7 @@ PHP if you have not done so prior to upgrading MediaWiki. * (bug 27020) API: Allow title prefix search of logevents (only when not in miser mode) * (bug 26629) add Special:MIMESearch to api +* (bug 27585) add pagecount to list=filearchive === Languages updated in 1.18 === diff --git a/includes/api/ApiQueryFilearchive.php b/includes/api/ApiQueryFilearchive.php index 22ca7cf415..6d52ff71cf 100644 --- a/includes/api/ApiQueryFilearchive.php +++ b/includes/api/ApiQueryFilearchive.php @@ -140,6 +140,11 @@ class ApiQueryFilearchive extends ApiQueryBase { } if ( $fld_size ) { $file['size'] = $row->fa_size; + + $pageCount = ArchivedFile::newFromRow( $row )->pageCount(); + if ( $pageCount !== false ) { + $vals['pagecount'] = $pageCount; + } } if ( $fld_dimensions ) { $file['height'] = $row->fa_height; -- 2.20.1