Last modified: 2010-05-15 15:54:54 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 14084 - FSRepo does not work well
FSRepo does not work well
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2008-05-11 03:56 UTC by barosl
Modified: 2010-05-15 15:54 UTC (History)
1 user (show)

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


Description barosl 2008-05-11 03:56:07 UTC
I'm using FSRepo for my wiki. After upgrading to 1.12.0, an internal error occurs when I see a foreign image file.


wfTimestamp() called with illegal output type.


#0 /home/barosl/public_html/dic.real/includes/filerepo/File.php(1030): wfTimestamp(1166106854)
#1 /home/barosl/public_html/dic.real/includes/ImagePage.php(421): File->getTimestamp()
#2 /home/barosl/public_html/dic.real/includes/ImagePage.php(87): ImagePage->imageHistory()
#3 /home/barosl/public_html/dic.real/includes/Wiki.php(390): ImagePage->view()
#4 /home/barosl/public_html/dic.real/includes/Wiki.php(48): MediaWiki->performAction(Object(OutputPage), Object(ImagePage), Object(Title), Object(User), Object(WebRequest))
#5 /home/barosl/public_html/dic.real/index.php(90): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(User), Object(WebRequest))
#6 /home/barosl/public_html/dic(20): require_once('/home/barosl/pu...')
#7 {main}


I found the implementation of wfTimestamp() in GlobalFunctions.php, and it says the first argument of the function must be $outputtype, not $ts. But getTimestamp() in filerepo/File.php calls the function as "wfTimestamp( filemtime( $path ) )". I think it is a bug.

After changing it to "wfTimestamp( TS_UNIX, filemtime( $path ) )", happily, the error doesn't occur. But, another warning occurs.


Warning: Invalid argument supplied for foreach() in /home/barosl/public_html/dic.real/includes/ImagePage.php on line 428


In the code of ImagePage.php: "$hist = $this->img->getHistory(); foreach( $hist as $file ) { ... }". And it calls getHistory() in filerepo/File.php. But strangely, getHistory() in filerepo/File.php is only a stub, just returning false.

When I change "return false;" of getHistory() in filerepo/File.php to "return array();", the warning does not occur. But I guess there might be a better solution.
Comment 1 Aaron Schulz 2008-05-11 03:57:44 UTC
I believe the first error was backported in to 1.12 SVN.

I'll look into the second.
Comment 2 Aaron Schulz 2008-05-11 14:55:05 UTC
Fixed in r34616 

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