r106770 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106769‎ | r106770 | r106771 >
Date:08:38, 20 December 2011
Author:aaron
Status:ok (Comments)
Tags:
Comment:
FU r106752: unbreak "other sizes" links on File: pages by working around the suck /media system.
Modified paths:
  • /trunk/phase3/includes/filerepo/file/File.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/file/File.php
@@ -756,10 +756,12 @@
757757 global $wgIgnoreImageErrors, $wgThumbnailEpoch;
758758
759759 $thumbPath = $this->getThumbPath( $thumbName ); // final thumb path
760 -
761760 if ( $this->repo && $this->repo->canTransformVia404() && !( $flags & self::RENDER_NOW ) ) {
762761 wfDebug( __METHOD__ . " transformation deferred." );
763 - return $this->handler->getTransform( $this, false, $thumbUrl, $params );
 762+ // XXX: Pass in the storage path even though we are not rendering anything
 763+ // and the path is supposed to be an FS path. This is due to getScalerType()
 764+ // getting called on the path and clobbering the $thumb->getUrl() if it's false.
 765+ return $this->handler->getTransform( $this, $thumbPath, $thumbUrl, $params );
764766 }
765767
766768 wfDebug( __METHOD__.": Doing stat for $thumbPath\n" );

Follow-up revisions

RevisionCommit summaryAuthorDate
r106850FU r106770: fixed the other getTransform() callaaron20:15, 20 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106752Merged FileBackend branch. Manually avoiding merging the many prop-only chang...aaron03:52, 20 December 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   08:40, 20 December 2011

This also unbreaks various thumbnails in pages.

#Comment by Brion VIBBER (talk | contribs)   20:00, 20 December 2011

There's still a false being passed in in File::maybeDoTransform():

		if ( $this->repo->fileExists( $thumbPath ) && !( $flags & self::RENDER_FORCE ) ) {
			$timestamp = $this->repo->getFileTimestamp( $thumbPath );
			if ( $timestamp !== false && $timestamp >= $wgThumbnailEpoch ) {
				return $this->handler->getTransform( $this, false, $thumbUrl, $params );
			}
		} elseif ( $flags & self::RENDER_FORCE ) {
			wfDebug( __METHOD__ . " forcing rendering per flag File::RENDER_FORCE\n" ); 
		}

Does this also need updating?

#Comment by Aaron Schulz (talk | contribs)   20:15, 20 December 2011

Good catch, see r106850.

Status & tagging log