Magento - blank / blank page when printing an invoice for a backend

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

I tried to debug this step by step, the problem is that I cannot enable error_reporting (I am in production mode)

Update:

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

+6
source share
4 answers

This is an incompatibility problem between PHP version 5.4.4-14 and Zend Framwork.

Fixed by commenting on __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(); 

Thanks!

+10
source

Edit

 lib/Zend/Pdf/FileParserDataSource.php 

change

 abstract public function __construct(); 

to

 abstract public function __construct($filePath); 
+13
source

Mischa Leiss and Rastaking corrections are absolutely correct, I thought I would add that editing the file on

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

not the best practice. Better copy the file to

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

and edit the file there. Magento will use this override version of the file, not the default, and you are unlikely to encounter problems in the future (for example, when trying to update the Magento kernel).

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

+6
source

Edit

 abstract public function __construct(); 

to

 abstract public function __construct($filePath); 

Fixed problem

0
source

Source: https://habr.com/ru/post/946948/


All Articles