[Mediawiki-l] Upgraded but broke an extension

Chris Lewis yecheondigital at yahoo.com
Mon Apr 9 18:02:09 UTC 2012


Also changing the code back to the original no longer gives a fatal error. I'm confused. It's like it's ignoring it all the sudden now. 


________________________________
 From: Chris Lewis <yecheondigital at yahoo.com>
To: MediaWiki announcements and site admin list <mediawiki-l at lists.wikimedia.org> 
Sent: Tuesday, April 10, 2012 2:26 AM
Subject: Re: [Mediawiki-l] Upgraded but broke an extension
 
Hi,

Thank you for replying. I changed the line
 $img = function_exists( 'wfFindFile' ) ? wfFindFile( $title ) : new Image( $title );


to

 $img= wfFindFile($title); 


and now when I hit the audio player it says "File not found." Unfortunately I don't know php and haven't been able to figure it out myself.

Thank you,

Chris

________________________________
From: Platonides <Platonides at gmail.com>
To: mediawiki-l at lists.wikimedia.org 
Sent: Monday, April 9, 2012 10:14 PM
Subject: Re: [Mediawiki-l] Upgraded but broke an extension

On 09/04/12 10:54, Chris Lewis wrote:
> I finally upgraded to Mediawiki 1.18 and while doing so it broke an mp3 player extension I was using (Flashmp3:http://www.mediawiki.org/wiki/Extension:FlashMP3 ). It looks like the person is no longer updating the extension as I saw a similar problem posted on the discussion section of the site.
> 
> Since no one updating it anymore and the fact my wiki contains a lot of audio and it's crucial I get this working, I was hoping someone here might be able to help me.
> 
> The error is : 
> "Fatal error: Class 'Image' not found".
> 
> for this piece of code: $img=function_exists('wfFindFile')? wfFindFile($title):newImage($title);
> 
> Anyone know what in the latest mediawiki would make this code return a fatal error?
> 
> Any help would be greatly appreciated.
> 
> Thank you,
> 
> Chris

The image class was removed in 9c03e7f7baf7515e459594e7fe02040fe358df25
It had been only provided for code earlier than MediaWiki 1.11

It's really strange that you're hitting that error, since wfFindFile has
existed since MediaWiki 1.7 (ed4303922f4e850418168595c2a22cdd895081cc)
and the new Image path should never be executed.

I tested with both PHP 5.2 and 5.3 and they don't require an Image class
at all in that case.

Anyway, just changing that line to $img= wfFindFile($title); should fix it.


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l at lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l at lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


More information about the MediaWiki-l mailing list