Stefand Posted October 29, 2010 Share Posted October 29, 2010 Hi everbody,I have update my shop to prestashop 1.3.2By the new order the PDF invoice can I open without problems.But by the orders from the past, it says only:Fatal errorAll my previous orders in the store have the same problem, I cann't open the invoice.The customer can also n't open it. (the same error)Can somebody help me with this issue? Link to comment Share on other sites More sharing options...
rocky Posted October 29, 2010 Share Posted October 29, 2010 Temporarily change line 403 of classes/Tools.php from: // if ($string == 'Fatal error') d(debug_backtrace()); to: if ($string == 'Fatal error') d(debug_backtrace()); This will display a stack trace instead of just "Fatal error". This should help you pinpoint the cause of the error. Link to comment Share on other sites More sharing options...
Stefand Posted October 29, 2010 Author Share Posted October 29, 2010 Ok,When I now try to open the PDF invoice in the admin I get this page:URL : pdf.php?id_order=436&pdf; Array [code] [0] => Array ( [file] => /home/pvc-tarp.com/www/classes/Cart.php [line] => 131 [function] => displayError [class] => Tools [type] => :: [args] => Array ( ) ) [1] => Array ( [file] => /home/pvc-tarp.com/www/classes/Order.php [line] => 402 [function] => getTaxesAverageUsed [class] => Cart [type] => :: [args] => Array ( [0] => 3455 ) ) [2] => Array ( [file] => /home/pvc-tarp.com/www/classes/PDF.php [line] => 469 [function] => getTaxesAverageUsed [class] => Order [type] => -> [object] => Order Object ( [id_address_delivery] => 590 [id_address_invoice] => 590 [id_cart] => 3455 [id_currency] => 1 [id_lang] => 3 [id_customer] => 522 [id_carrier] => 137 [secure_key] => 6360ef001c7a2a3f1febde1743dc5faa [payment] => PayPal [module] => paypal [recyclable] => 1 [gift] => 0 [gift_message] => [shipping_number] => [total_discounts] => 0.00 [total_paid] => 43.40 [total_paid_real] => 43.40 [total_products] => 32.29 [total_products_wt] => 37.41 [total_shipping] => 6.00 [total_wrapping] => 0.00 [invoice_number] => 432 [delivery_number] => 374 [invoice_date] => 2010-10-21 23:00:16 [delivery_date] => 2010-10-22 10:01:03 [valid] => 1 [date_add] => 2010-10-21 23:00:15 [date_upd] => 2010-10-25 19:33:30 [tables:protected] => Array ( [0] => orders ) [fieldsRequired:protected] => Array ( [0] => id_address_delivery [1] => id_address_invoice [2] => id_cart [3] => id_currency [4] => id_lang [5] => id_customer [6] => id_carrier [7] => payment [8] => total_paid [9] => total_paid_real [10] => total_products [11] => total_products_wt ) [fieldsSize:protected] => Array ( [payment] => 32 ) [fieldsValidate:protected] => Array ( [id_address_delivery] => isUnsignedId [id_address_invoice] => isUnsignedId [id_cart] => isUnsignedId [id_currency] => isUnsignedId [id_lang] => isUnsignedId [id_customer] => isUnsignedId [id_carrier] => isUnsignedId [secure_key] => isMd5 [payment] => isGenericName [recyclable] => isBool [gift] => isBool [gift_message] => isMessage [total_discounts] => isPrice [total_paid] => isPrice [total_paid_real] => isPrice [total_products] => isPrice [total_products_wt] => isPrice [total_shipping] => isPrice [total_wrapping] => isPrice [shipping_number] => isUrl ) [table:protected] => orders [identifier:protected] => id_order [_taxCalculationMethod:private] => 0 [id] => 436 [fieldsRequiredLang:protected] => Array ( ) [fieldsSizeLang:protected] => Array ( ) [fieldsValidateLang:protected] => Array ( ) ) [args] => Array ( ) ) Link to comment Share on other sites More sharing options...
rocky Posted October 29, 2010 Share Posted October 29, 2010 From that stack trace, it seems the order is referencing a cart that doesn't exist. Make sure that a cart with ID 3455 exists in your ps_cart table. Link to comment Share on other sites More sharing options...
Stefand Posted October 29, 2010 Author Share Posted October 29, 2010 That was the solution for me as admin.But the customer still cann't download the pdf invoice, they get this error:FPDF error: Some data has already been output, can't send PDF file Link to comment Share on other sites More sharing options...
rocky Posted October 30, 2010 Share Posted October 30, 2010 This was supposed to be fixed in v1.3.2. That error occurs when an error message is displayed before writing the PDF file. Try manually entering the URL like pdf-invoice.php?id_order=1 and see if an error message is displayed. Link to comment Share on other sites More sharing options...
Stefand Posted October 30, 2010 Author Share Posted October 30, 2010 the same error. Link to comment Share on other sites More sharing options...
rocky Posted October 30, 2010 Share Posted October 30, 2010 I can't help without more information. Try adding the following before line 271 of tools/fpdf/fpdf.php from: die('FPDF error: '.$msg); to: var_dump(debug_backtrace()); die('FPDF error: '.$msg); This should provide more information about the error. Link to comment Share on other sites More sharing options...
Stefand Posted October 30, 2010 Author Share Posted October 30, 2010 see my last post. Link to comment Share on other sites More sharing options...
rocky Posted October 30, 2010 Share Posted October 30, 2010 No, I can't see. For security reasons, only the customer who completed the order can see the invoice. You will need to post the error message here. Link to comment Share on other sites More sharing options...
Stefand Posted October 31, 2010 Author Share Posted October 31, 2010 ok, I see this code, and then 4 pages... array(3) { [0]=> array(7) { ["file"]=> string(42) "/home/pvc-tarp.com/www/tools/fpdf/fpdf.php" ["line"]=> int(1032) ["function"]=> string(5) "Error" ["class"]=> string(4) "FPDF" ["type"]=> string(2) "->" ["object"]=> object(PDF)#13 (61) { ["NewPageGroup"]=> bool(false) ["PageGroups"]=> array(1) { ["{nb1}"]=> int(1) } ["CurrPageGroup"]=> string(5) "{nb1}" ["page"]=> int(1) ["n"]=> int(9) ["offsets"]=> array(9) { [3]=> int(9) [4]=> int(376) [1]=> int(1739) [5]=> int(1826) [6]=> int(1927) [7]=> int(2023) [2]=> int(43055) [8]=> int(43179) [9]=> int(43254) } ["buffer"]=> string(43636) "%PDF-1.3 3 0 obj <<<>>><<>>>] /Contents 4 0 R>> endobj 4 0 obj <> stream x��WKS�8>O��}���=-�[�c��l�=��!$"�$�80ˉ��-?bہj���O��u����%J�s�'���(���(��@�!LWpx��d �c8�L��69����J)���0?<������ \e����}��d��Mm�`��nX0�5ta�Ih������b0��9�8i��a�14�;]nV�d�l�x�ďXf���@d�Zi5:�����/�ɲ��85�Af{ig6YN�Yq�%�dP�?��r�A@�%Q�L�_-�'��`�I��ݾTJ��lF�8e������ �!aV�J��r � M�<<&��v���钠��P̓�:�+�Jw��F��\�7�Q�a� �m4�D�p��S���b�q���T��a�c �՝���ɯ<�?���á,=�W`Aw4%�bEQI���#���n��D>�< ��[� /��-��$�w]�nQ�R�bW �r]����2��h���hz���X �3Gb]�r8B� �B1���$�q���U�|o}ID�oξJ�)pl��7����P�ٰ�R�٤�g�{�(nx����M�7 �%����8�u::9w�,<��M�����&t;�,�%�M��ܯO�u�%��������oHE��2��v/�jn�jq�X����f���@����̸y�]{��-7G���>m�C:8��2���F��T C�z�>�-�/|G����n��pp�vq׃�P�z��'�����Q���w�rW���|� endstream endobj 1 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj 7 0 obj <> stream �����JFIF���������;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90 ���C� ���C ���a"�������������� �������}�!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz����������������������������������������������������������������������������������� ������w�!1AQaq"2�B���� #3R�br� $4�%�&'()*567 Link to comment Share on other sites More sharing options...
rocky Posted October 31, 2010 Share Posted October 31, 2010 It's line 1032 of tools/fpdf/fpdf.php that is causing the error: if(ob_get_length()) $this->Error('Some data has already been output, can\'t send PDF file'); It seems ob_get_length() is returning a length greater than 0 when it shouldn't. Unfortunately, I have no idea how to fix it. Link to comment Share on other sites More sharing options...
Stefand Posted October 31, 2010 Author Share Posted October 31, 2010 Hm. rocky thanks for the gimp, when somebody else know the solution for this problem, let me know! Link to comment Share on other sites More sharing options...
DutchCoding Posted October 31, 2010 Share Posted October 31, 2010 Send me your PDF.php Link to comment Share on other sites More sharing options...
Stefand Posted November 1, 2010 Author Share Posted November 1, 2010 Done, nothing wrong in the PDF.php file...I need a solution for this problem, anyone? Link to comment Share on other sites More sharing options...
Straigh&Alert Posted November 7, 2010 Share Posted November 7, 2010 i have the same probleme, done what you've said and it seems : It’s line 1032 of tools/fpdf/fpdf.php that is causing the error: does anyone has already solved this pb ? Link to comment Share on other sites More sharing options...
Straigh&Alert Posted November 7, 2010 Share Posted November 7, 2010 I've found an answer working for me here :http://www.prestashop.com/forums/viewthread/28190/I had two white space after the closing tag in classes/product.php Link to comment Share on other sites More sharing options...
marcosaluzzo Posted November 7, 2010 Share Posted November 7, 2010 I have just upgraded to 1.3.2.3 I get the following message:Fatal error: Call to undefined method Cart::getTaxesAverageUsed() in /dirpathway/shop/classes/Order.php on line 408when viewing customer order pdfs in the front end.I have tried Straigh&Alert;'s solution of removing the extract white spaces after the ?> in classed/Product.php but I still get this message. A quick solution to this problem is most appreciated.Thanks, Marco Link to comment Share on other sites More sharing options...
Rhapsody Posted December 12, 2010 Share Posted December 12, 2010 I just updated from 1.3.2 to 1.3.3 and get the error when trying to generate a PDF invoice for an old order. Other orders generate a PDF just fine. The problem is both on the backend and when the user is logged in the front end.Here's related debug info. I kept the old 1.3.2 directory and renamed it. By renaming the old and new installs so the old 1.3.2 version is active, I am able to generate a PDF invoice.Enabling debug in the Tools.php results in the following for the 1.3.3 version. Array ( [0] => Array ( [file] => /home/j30/www/www/shop/classes/Cart.php [line] => 130 [function] => displayError [class] => Tools [type] => :: [args] => Array ( ) ) [1] => Array ( [file] => /home/j30/www/www/shop/classes/Order.php [line] => 415 [function] => getTaxesAverageUsed [class] => Cart [type] => :: [args] => Array ( [0] => 14 ) ) [2] => Array ( [file] => /home/j30/www/www/shop/classes/PDF.php [line] => 467 [function] => getTaxesAverageUsed [class] => Order [type] => -> [object] => Order Object ( [id_address_delivery] => 8 [id_address_invoice] => 8 [id_cart] => 14 [id_currency] => 2 [id_lang] => 1 [id_customer] => 2 [id_carrier] => 17 [secure_key] => ****************************** deleted [payment] => PayPal [module] => paypal [recyclable] => 0 [gift] => 0 [gift_message] => [shipping_number] => [total_discounts] => 0.00 [total_paid] => 70.00 [total_paid_real] => 70.00 [total_products] => 60.00 [total_products_wt] => 60.00 [total_shipping] => 10.00 [total_wrapping] => 0.00 [invoice_number] => 6 [delivery_number] => 4 [invoice_date] => 2010-11-23 11:40:40 [delivery_date] => 2010-12-09 22:07:51 [valid] => 1 [date_add] => 2010-11-23 11:40:38 [date_upd] => 2010-12-11 23:02:46 [tables:protected] => Array ( [0] => orders ) [fieldsRequired:protected] => Array ( [0] => id_address_delivery [1] => id_address_invoice [2] => id_cart [3] => id_currency [4] => id_lang [5] => id_customer [6] => id_carrier [7] => payment [8] => total_paid [9] => total_paid_real [10] => total_products [11] => total_products_wt ) [fieldsSize:protected] => Array ( [payment] => 32 ) [fieldsValidate:protected] => Array ( [id_address_delivery] => isUnsignedId [id_address_invoice] => isUnsignedId [id_cart] => isUnsignedId [id_currency] => isUnsignedId [id_lang] => isUnsignedId [id_customer] => isUnsignedId [id_carrier] => isUnsignedId [secure_key] => isMd5 [payment] => isGenericName [recyclable] => isBool [gift] => isBool [gift_message] => isMessage [total_discounts] => isPrice [total_paid] => isPrice [total_paid_real] => isPrice [total_products] => isPrice [total_products_wt] => isPrice [total_shipping] => isPrice [total_wrapping] => isPrice [shipping_number] => isUrl ) [table:protected] => orders [identifier:protected] => id_order [_taxCalculationMethod:private] => 0 [id] => 6 [fieldsRequiredLang:protected] => Array ( ) [fieldsSizeLang:protected] => Array ( ) [fieldsValidateLang:protected] => Array ( ) ) [args] => Array ( ) ) [3] => Array ( [file] => /home/j30/www/www/shop/pdf-invoice.php [line] => 20 [function] => invoice [class] => PDF [type] => :: [args] => Array ( [0] => Order Object ( [id_address_delivery] => 8 [id_address_invoice] => 8 [id_cart] => 14 [id_currency] => 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now