User talk:Edwardmolasses/ExportForm

From Meta, a Wikimedia project coordination wiki

Error in DocumentExport.php script.[edit]

When I load the script and make the appropriate changes to the other pages, I get the following error:

Parse error; syntax error, unexpected ";", expecting T_Function in DocumentExport.php on line 301

I've setup some other installations with the extension that's linked to this page and I haven't been able to duplicate the error. I'm guessing that the error is originating from something else. Which version of MediaWiki are you using?

--Edwardmolasses 01:52, 4 March 2006 (UTC)[reply]


I experience the same "Parse error" behavior on a clean MediaWiki 1.5.6 installation. No other extensions running. Might it be that the conversion from the DocumentExport.pdf to a .php harms sth. Could you please post the php file instead of the pdf one? Others do so to.

Marc 11 March 2006


Here's a link to a copy of the DocumentExport.php file (change name to DocumentExport.php after downloading) that's currently running on the pgr dictionary. It's a bit messy, with lots of debugging code left in and commented out, but if this one doesn't work, then i'll have to take a closer look at what's going on! Please let me know if there are still problems.

--Edwardmolasses 20:20, 12 March 2006 (UTC)[reply]


Thanks a lot for making the text file available. What shall I say: it worked. Nevertheless I have warning messages when calling Special:DocumentExport. Apparently the following variables are undefined hits (line 357), searchMatches (line 161), overLimitError (line 189), output (line 202). I proceeded with the export: HTML worked like a charm, PDF was empty. I really don't get the changes which need to de done in the monobook skin. Any hint for me? Thanks a lot for your help and this extension!

Marc 13 March 2006


Hmm, i'm still not sure why these errors are appearing. When i have some time i'll take another look. In the meantime, you could try temporarily disabling the display of warnings in PHP for just the extension by including one of the following lines near the beginning of the page (DocumentExport.php: after the openingn php tag):

error_reporting(E_ALL ^ E_NOTICE);

or

error_reporting(E_ALL ^ E_WARNING);

More information about the error reporting function in PHP is over here. About the skin though, if you are using monobook, you shouldn't have to make any change. The instructions about changes are for other skins, and they're taken directly from the HTML2FPDF page here on meta-wiki. I hope this helps, and you're welcome for the extension!

--Edwardmolasses 17:55, 14 March 2006 (UTC)[reply]

Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\wiki\extensions\DocumentExport.php:1) in C:\wamp\www\wiki\includes\OutputPage.php on line 462[edit]

I like your very cool extension very much and wanted to use it on my MediaWiki too. Unfortunatly it doesn't work. Every time when i write your code in localsettings.php i get an error message: Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\wiki\extensions\DocumentExport.php:1) in C:\wamp\www\wiki\includes\OutputPage.php on line 462....

I am not really a PHP Pro and I have no plan what this could be. Do you have any ideas? Could it be because of the Version of MediaWiki?

Thank you for your help.

Ack, i'm sorry i didn't get an update for your message. But hmm, which version are you using? I can't comment on the error at the moment, since it's been a while since i tinkered with mediawiki, but i'm thinking that this is a common one. Perhaps you could try adding the text version of the extension as it seemed to clear up some bugs that other people had. You can download it here. Just change the .txt to .php before installing. I hope this helps! --Edwardmolasses 04:25, 22 August 2006 (UTC)[reply]




hm unfortunatly it doesn't help.... I'm using Media Wiki 1.7.1. I think there is somethin with the HTML2FPDF. I've have copied all the files into the includes directory (no directory in there, just the files) and modified my index.php, but it doesn't work, the message is still there. I've heard that MediaWiki have changed since version 1.5. and thats my explanation why it doesn't work *g* Fact is, when I add your code into index.php there is some output before the header output in outputpage.php....

The message with Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\wiki\extensions\DocumentExport.php:1) in C:\wamp\www\wiki\includes\OutputPage.php on line 587 haven't I get anymore.... Its always Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\wiki\index.php:1) in C:\wamp\www\wiki\includes\OutputPage.php on line 587

What do you think? Have I done something wrong or is it just because of the MediaWiki Version?

Thank you for your help

--k4lisp3r4 24 August 2006


I have solved this problem. Unfortunitly there were some characters before or after the PHP tags which weren't shown in my Editor (UltraEdit) after copying your code into index.php. Nice bug.... You just have to copy the content of the index file into another file and name it index.php.

Afterwards there was another error:

Fatal error: Call to a member function getID() on a non-object in C:\wamp\www\wiki\includes\SkinTemplate.php on line 311

here you have to insert in DocumentExport.php just after

function execute( $par ) { global $wgOut, $wgUser, $wgDBname, $wgInputEncoding, $wgRequest, $wgBoardVoteDB, $wgBoardVoteEditCount; global $wgParser, $wgMsgParserOptions, $wgTitle, $wgExportLimit;

this code

$wgOut->setArticleRelated( false );

Now I am able to watch the layout and to press the buttons, but the search query doesn't work at all.... I can insert some text into the query textbox and then I press the button but nothing appears in the textarea.... really nothing but i know that some pages exist which have this title and so on..... Now I am trying to find the reason for this error, but I don't understand the search logic and debugging in PHP & MediaWiki is a really hard thing.

When i want to convert a page into PDF, the following error appears

FPDF error: Some data has already been output, can't send PDF file

maybe there is just another output before the PHP tags, I just don't know....

I am a bit desperate, because I have to implement such a feature for Export. I am sorry for my English, it's not the best and i want to thank you for your help

--k4lisp3r4 25 August 2006