Last modified: 2012-02-27 08:48:01 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36654, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34654 - rebuildImages.php --missing halts with error upon encountering any filename which it wants to rename
rebuildImages.php --missing halts with error upon encountering any filename w...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
1.20.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-23 21:36 UTC by Carl Austin Bennett
Modified: 2012-02-27 08:48 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Carl Austin Bennett 2012-02-23 21:36:17 UTC
In function addMissingImage( $filename, $fullpath ) line 193 on http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/maintenance/rebuildImages.php?view=markup is a call to a function which isn't yet implemented:

192 	# @FIXME: create renameFile()
193 	$filename = $this->renameFile( $filename );

If renameFile() hasn't been written yet, we really shouldn't be calling it yet. The end result appears to be that, as soon as the script finds one file which fails to match checkTitleEncoding() (for instance, 'example.jpg' on a wiki where that should've been 'Example.jpg') it stops dead in its tracks with:

PHP Fatal error:  Call to undefined method ImageBuilder::renameFile() in .../phase3/maintenance/rebuildImages.php on line 193

That means any subsequent missing images don't even get looked at.

One possible solution would be the bug 27645 proposal of adding 'some
commandline option such as "--skip-unreadable" or similar'.

A simpler solution would be to simply comment out or remove the call to renameFile() if (as the FIXME indicates) the function simply does not exist.

That will mean that 'example.jpg' still doesn't get renamed 'Example.jpg' but at least the search for missing images would not grind to a screeching halt.
Comment 1 Tim Starling 2012-02-27 03:05:00 UTC
renameFile() was in FiveUpgrade.inc, so IAlex broke this in r72726. The fixme comment was added later by someone who didn't realise that the function in question was created in r9758.
Comment 2 Alexandre Emsenhuber [IAlex] 2012-02-27 06:53:56 UTC
In such case I can also say that you broke it in r22580 by removing wfImageDir() which was used by renameFile().
Comment 3 Tim Starling 2012-02-27 08:48:01 UTC
(In reply to comment #2)
> In such case I can also say that you broke it in r22580 by removing
> wfImageDir() which was used by renameFile().

Touché.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links