> Shortly afterwards the systems comes back telling me that the document
> has been successfully created. When I klick the download-link, an
> empty page opens. Trying to save the link results in saving a file,
> called collection.pdf, with 0 bytes.
Are there any errors or warnings in your web server log?
--
Cheers
Ralf
--- GlobalFunctions.php 2009-03-25 03:07:09.000000000 +0100
+++ GlobalFunctions.php 2010-07-17 23:33:17.000000000 +0200
@@ -1239,6 +1239,9 @@
*/
function wfAppendQuery( $url, $query ) {
if( $query != '' ) {
+ if ( is_array( $query ) ) {
+ $query = http_build_query( $query );
+ }
if( false === strpos( $url, '?' ) ) {
$url .= '?';
} else {
2. the php problem.--- Collection.body.php 2010-07-18 01:38:38.000000000 +0200
+++ Collection.body.php.patched 2010-07-18 01:38:30.000000000 +0200
@@ -1144,7 +1144,8 @@ EOS
global $wgRequest;
global $wgCollectionContentTypeToFilename;
- $tempfile = tmpfile();
+ $tmpfname = tempnam("/tmp", "mwlib-pdf");
+ $tempfile = fopen($tmpfname, "w");
$r = self::mwServeCommand( 'render_status', array(
'collection_id' => $wgRequest->getVal( 'collection_id' ),
'writer' => $wgRequest->getVal( 'writer' ),
@@ -1181,8 +1182,9 @@ EOS
header( 'Content-Disposition: ' . 'inline; filename=' . $wgCollectionContentTypeToFilename[$ct] );
}
}
- fseek( $tempfile, 0 );
- fpassthru( $tempfile );
+ if (is_resource($tempfile))
+ fclose($tempfile);
+ readfile( $tmpfname );
$wgOut->disable();
}
@@ -1374,6 +1376,9 @@ EOS
if ( !$toFile ) {
$text = $result;
}
+ else {
+ fclose( $toFile );
+ }
$errorMessage = '';
}
curl_close( $c );
error_reporting( E_ALL ); ini_set( 'display_errors', 1 );
+ readfile( $tmpfname );
> I tried again to download a page of my wiki as a PDF and I was able to
> download collection.pdf, which contained the following lines:
>
> <br />
> <b>Warning</b>: readfile() [<a
> href='function.readfile'>function.readfile</a>]: Filename cannot be empty
> in
> <b>/is/htdocs/wp1045034_DIC9D7OW2C/www/frankfurt.vij.de/wikijusta/extensions/Collection/Collection.body.php</b>
> on line <b>1127</b><br />
>
> The warning refers to the line of patch that I inserted into
> Collection.body.php:
>
> + readfile( $tmpfname );
>
>
> This suggests to me that somehow the pdf doesn't get filled on the
> pediapress server.
why?
When I try to print a page from my own wiki I never encountered steps 2 and 3.
Does this info help you to help me? If not, what else can I do to make my problem clearer?
It can't be that our wiki is the only wiki that can't produce PDFs.
Thanks for you help,
flieger
flieger <> writes:
> I tried again to download a page of my wiki as a PDF and I was able to
> download collection.pdf, which contained the following lines:
>
> <br />
> <b>Warning</b>: readfile() [<a
> href='function.readfile'>function.readfile</a>]: Filename cannot be empty
> in
> <b>/is/htdocs/wp1045034_DIC9D7OW2C/www/.../extensions/Collection/Collection.body.php</b>
> on line <b>1127</b><br />
>
> The warning refers to the line of patch that I inserted into
> Collection.body.php:
>
> + readfile( $tmpfname );
>
>
> This suggests to me that somehow the pdf doesn't get filled on the
> pediapress server.
why?