t.c
t.c

Reputation: 1257

Magento - blank/empty page when printing invoice on backend

I am working on Magento 1.5, and when I try to print any of my invoices, on the backend, I got a white/empty page.

I've tried to debug this step by step, the problem is that I can't put the error_reporting on (I'm on a production mode)

Update:

[Mon Jun 10 12:35:53 2013] [error] [client 196.203.53.248] PHP Fatal error: Declaration of Zend_Pdf_FileParserDataSource_File::__construct() must be compatible with Zend_Pdf_FileParserDataSource::__construct() in /home/webmaster/public_html/www/lib/Zend/Pdf/FileParserDataSource/File.php on line 41, referer: http://www.example.com/index.php/admin/sales_invoice/view/invoice_id/15/

Upvotes: 6

Views: 9433

Answers (4)

Nick
Nick

Reputation: 1

Change

abstract public function __construct();

to

abstract public function __construct($filePath);

Fixed the issue

Upvotes: 0

t.c
t.c

Reputation: 1257

This is an incompatibility issue between PHP Version 5.4.4-14 and Zend Framwork.

Fixed it by commenting out __construct() and __destruct() methods in lib/Zend/Pdf/FileParserDataSource.php

//    abstract public function __construct();

    /**
     * Object destructor. Closes the data source.
     *
     * May also perform cleanup tasks such as deleting temporary files.
     */
//    abstract public function __destruct(); 

Thank you !

Upvotes: 10

siliconrockstar
siliconrockstar

Reputation: 3664

Mischa Leiss's and Rastaking's fixes are completely correct, thought I would like to add that editing the file at

[magento root]/lib/Zend/Pdf/FileParserDataSource.php 

is not best practice. Better to copy the file to

[magento root]/app/code/local/Zend/Pdf/FileParserDataSource.php

and edit the file there. Magento will use this overriding version of the file, instead of the default, and you are less likely to run into issues in the future (like when you try to upgrade Magento core).

Also, this probably should have been a comment, but it was difficult to read without formatting.

Upvotes: 6

Michael Leiss
Michael Leiss

Reputation: 5670

Edit

lib/Zend/Pdf/FileParserDataSource.php

change

abstract public function __construct();

to

abstract public function __construct($filePath);

Upvotes: 14

Related Questions