mediawiki-extensions / wiki2latex

Automatically exported from code.google.com/p/wiki2latex
0 stars 0 forks source link

PHP Fatal error: Class 'Image' not found #72

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. If there is an image in a articel, like [[Image: Test.png]]
2.
3.

What is the expected output? What do you see instead?
Nothing

What version of Wiki2LaTeX are you using? On which Mediawiki version?
mediawiki 1.82.2, PHP 5.3.5-1ubuntu7.1, Wiki2LaTeX latest 
w2l-2011-02-22_Aegaeon.zip

Please provide any additional information below.
In /var/log/apache2/error.log i see PHP Fatal error:  Class 'Image' not found

Original issue reported on code.google.com by cf...@web.de on 24 Apr 2012 at 7:57

GoogleCodeExporter commented 8 years ago
Seems like the old Image Object was removed from Mediawiki.

It is probably located at line 979 in w2lParser.php. I just updated this part 
to work with the new API, but I do not recommend to simply take the current 
w2lParser from the repo.

Please try this:
In your local w2lParser.php look for this line:

$file = Image::newFromTitle( $title );

and replace it with this one:

$file = LocalFile::newFromTitle( $title );

I have not been able to test it, but it might work. Let's hope the best :) If 
it does not work, we might have a more severe issue here. Then this issue could 
take some time.

Thanks for pinting out this issue. It would have slipped through my attention I 
suppose and the next version would be quite flawed.

Original comment by hansgeorg.kluge@gmail.com on 24 Apr 2012 at 8:07

GoogleCodeExporter commented 8 years ago
Hello Hans-Georg,

thanks for the fast support. Yes, the old image was overwritte by new one in 
mediawiki. I've changed the line in w2lParser.php, but now there are other 
errors in /var/log/apach2/error.log:

[Wed Apr 25 13:59:03 2012] [error] [client 127.0.0.1] PHP Warning:  Missing 
argument 2 for LocalFile::newFromTitle(), called in 
/var/www/mediawiki-1.18.2/extensions/w2l_org/w2lParser.php on line 978 and 
defined in /var/www/mediawiki-1.18.2/includes/filerepo/LocalFile.php on line 
73, referer: 
https://www.xxx.de/wiki/index.php?title=My_Portal&action=w2llatexform
[Wed Apr 25 13:59:03 2012] [error] [client 127.0.0.1] PHP Notice:  Undefined 
variable: repo in /var/www/mediawiki-1.18.2/includes/filerepo/LocalFile.php on 
line 74, referer: 
https://www.xxx.de/wiki/index.php?title=My_Portal&action=w2llatexform
[Wed Apr 25 13:59:03 2012] [error] [client 127.0.0.1] PHP Fatal error:  Call to 
a member function getZonePath() on a non-object in 
/var/www/mediawiki-1.18.2/includes/filerepo/File.php on line 256, referer: 
https://www.xxx.de/wiki/index.php?title=My_Portal&action=w2llatexform 

I can make also some test on my system with a new version. For this i have a 
symbolic link in /var/www/ediawiki-1.18.2/extensions from w2l to wl2_org. So i 
can switch easily to a new or other version. 

Thanks and regards
Claus

Original comment by cf...@web.de on 26 Apr 2012 at 6:35

GoogleCodeExporter commented 8 years ago
Hello Hans-Georg,

i have found the problem. This function newFromTitle needs also the repository. 
For  my local repository i've changed these two lines. But i think it is not 
the best way and/or right position to set the repository.

$this->repo = RepoGroup::singleton()->getLocalRepo();
$file = LocalFile::newFromTitle( $title, $this->repo );

Regards Claus

Original comment by cf...@web.de on 14 May 2012 at 9:43