From 810bb7b79f259e42a136ec506bd564fcf80fa6a0 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Fri, 27 Jan 2012 22:44:46 +0000 Subject: [PATCH] Follow-up r83791: do not show size links for wikis which do not use a 404 transform, since this is a rather expensive operation, which can delay loading for several seconds. --- RELEASE-NOTES-1.19 | 1 + includes/ImagePage.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 56dda5431f..72d22ab31a 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -239,6 +239,7 @@ production. the edit. * (bug 33902) Decoding %2B with mw.Uri.decode results in ' ' instead of + * (bug 33762) QueryPage-based special pages no longer misses *-summary message. +* Other sizes links are no longer generated for wikis without a 404 thumbnail handler. === API changes in 1.19 === * Made action=edit less likely to return "unknownerror", by returning the actual error diff --git a/includes/ImagePage.php b/includes/ImagePage.php index a44a7d353d..eacfd358fd 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -330,11 +330,14 @@ class ImagePage extends Article { } $msgsmall = wfMessage( 'show-big-image-preview' )-> rawParams( $this->makeSizeLink( $params, $width, $height ) )-> - parse() . ' ' . + parse(); + if ( count( $otherSizes ) && $this->displayImg->getRepo()->transformVia404 ) { + $msgsmall .= ' ' . Html::rawElement( 'span', array( 'class' => 'mw-filepage-other-resolutions' ), wfMessage( 'show-big-image-other' )->rawParams( $wgLang->pipeList( $otherSizes ) )-> params( count( $otherSizes ) )->parse() ); + } } elseif ( $width == 0 && $height == 0 ){ # Some sort of audio file that doesn't have dimensions # Don't output a no hi res message for such a file -- 2.20.1