Last modified: 2010-05-15 15:54:54 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 T16084, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 14084 - FSRepo does not work well
FSRepo does not work well
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.12.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  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: ---


Attachments

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.

Backtrace:

#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.


Navigation
Links