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/
Edit
lib/Zend/Pdf/FileParserDataSource.php
change
abstract public function __construct();
to
abstract public function __construct($filePath);
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 !
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With