Hi,

I have some additional info that might help analyzing the problem.  After 
searching the internet I found a similar problem on this site:
http://www.mediawiki.org/wiki/Extension_talk:Collection/Archive_1#Book_has_0_Bytes

I applied the patches indicated there, since my version of php is 5.2.17.

1. the array problem:

--- 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 );


This morning I added two lines of debugging code to the beginning of 
localsettings.php, as indicated here: 
http://www.mediawiki.org/wiki/Manual:How_to_debug

error_reporting( E_ALL );ini_set( 'display_errors', 1 );


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.

What do you think?

flieger







Am Freitag, 2. März 2012 11:26:01 UTC+1 schrieb flieger:
>
> Hi, 
>
> I have a problem with downloading pdf-files.  I am using the default 
> public rendering service, as set in collection.php: 
> $wgCollectionMWServeURL = 'http://tools.pediapress.com/mw-serve/'; 
>
> After klicking the link to generate a pdf-file of the current page, I 
> get the following message: 
> "data fetched.  waiting for render process.." 
>
> 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. 
>
> these are my relevant settings in localsettings.php: 
>
> require_once("$IP/extensions/Collection/Collection.php"); 
> $wgEnableApi = true; 
> $wgEnableWriteAPI = true; 
> $wgCollectionMWServeCredentials = "user:user-pwd"; 
> $wgGroupPermissions['user']['collectionsaveasuserpage'] = true; 
> $wgGroupPermissions['autoconfirmed']['collectionsaveascommunitypage'] 
> = true; 
>
> Any help much appreciated. 
>
> Thanks, 
>
> flieger 
>

Am Freitag, 2. März 2012 11:26:01 UTC+1 schrieb flieger:
>
> Hi, 
>
> I have a problem with downloading pdf-files.  I am using the default 
> public rendering service, as set in collection.php: 
> $wgCollectionMWServeURL = 'http://tools.pediapress.com/mw-serve/'; 
>
> After klicking the link to generate a pdf-file of the current page, I 
> get the following message: 
> "data fetched.  waiting for render process.." 
>
> 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. 
>
> these are my relevant settings in localsettings.php: 
>
> require_once("$IP/extensions/Collection/Collection.php"); 
> $wgEnableApi = true; 
> $wgEnableWriteAPI = true; 
> $wgCollectionMWServeCredentials = "user:user-pwd"; 
> $wgGroupPermissions['user']['collectionsaveasuserpage'] = true; 
> $wgGroupPermissions['autoconfirmed']['collectionsaveascommunitypage'] 
> = true; 
>
> Any help much appreciated. 
>
> Thanks, 
>
> flieger 
>

Am Freitag, 2. März 2012 11:26:01 UTC+1 schrieb flieger:
>
> Hi, 
>
> I have a problem with downloading pdf-files.  I am using the default 
> public rendering service, as set in collection.php: 
> $wgCollectionMWServeURL = 'http://tools.pediapress.com/mw-serve/'; 
>
> After klicking the link to generate a pdf-file of the current page, I 
> get the following message: 
> "data fetched.  waiting for render process.." 
>
> 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. 
>
> these are my relevant settings in localsettings.php: 
>
> require_once("$IP/extensions/Collection/Collection.php"); 
> $wgEnableApi = true; 
> $wgEnableWriteAPI = true; 
> $wgCollectionMWServeCredentials = "user:user-pwd"; 
> $wgGroupPermissions['user']['collectionsaveasuserpage'] = true; 
> $wgGroupPermissions['autoconfirmed']['collectionsaveascommunitypage'] 
> = true; 
>
> Any help much appreciated. 
>
> Thanks, 
>
> flieger 
>

Am Freitag, 2. März 2012 11:26:01 UTC+1 schrieb flieger:
>
> Hi, 
>
> I have a problem with downloading pdf-files.  I am using the default 
> public rendering service, as set in collection.php: 
> $wgCollectionMWServeURL = 'http://tools.pediapress.com/mw-serve/'; 
>
> After klicking the link to generate a pdf-file of the current page, I 
> get the following message: 
> "data fetched.  waiting for render process.." 
>
> 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. 
>
> these are my relevant settings in localsettings.php: 
>
> require_once("$IP/extensions/Collection/Collection.php"); 
> $wgEnableApi = true; 
> $wgEnableWriteAPI = true; 
> $wgCollectionMWServeCredentials = "user:user-pwd"; 
> $wgGroupPermissions['user']['collectionsaveasuserpage'] = true; 
> $wgGroupPermissions['autoconfirmed']['collectionsaveascommunitypage'] 
> = true; 
>
> Any help much appreciated. 
>
> Thanks, 
>
> flieger 
>

Am Freitag, 2. März 2012 11:26:01 UTC+1 schrieb flieger:
>
> Hi, 
>
> I have a problem with downloading pdf-files.  I am using the default 
> public rendering service, as set in collection.php: 
> $wgCollectionMWServeURL = 'http://tools.pediapress.com/mw-serve/'; 
>
> After klicking the link to generate a pdf-file of the current page, I 
> get the following message: 
> "data fetched.  waiting for render process.." 
>
> 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. 
>
> these are my relevant settings in localsettings.php: 
>
> require_once("$IP/extensions/Collection/Collection.php"); 
> $wgEnableApi = true; 
> $wgEnableWriteAPI = true; 
> $wgCollectionMWServeCredentials = "user:user-pwd"; 
> $wgGroupPermissions['user']['collectionsaveasuserpage'] = true; 
> $wgGroupPermissions['autoconfirmed']['collectionsaveascommunitypage'] 
> = true; 
>
> Any help much appreciated. 
>
> Thanks, 
>
> flieger 
>

-- 
You received this message because you are subscribed to the Google Groups 
"mwlib" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/mwlib/-/pHVjr2zrpsUJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/mwlib?hl=en.

Reply via email to