• Resolved moonwalk

    (@j0321)


    It’s the thrid time now that my shop is getting this error when trying to generate the PDF invoice. WP triggers a fatal error email sent to the admin mailbox, and the PDF cannot be generated or re-generated at all – this happens with particular orders and probably once every 2 months now.

    Fatal error: Call to a member function get_reason() on int
    /public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php (2409) 0 /public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php(2444): WC_Order->add_order_item_totals_refund_rows() 1 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocumentMethods.php(948): WC_Order->get_order_item_totals() 2 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/templates/Simple/invoice.php(162): WPO\IPS\Documents\OrderDocumentMethods->get_woocommerce_totals() 3 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocument.php(1754): include(‘…’) 4 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocument.php(1610): WPO\IPS\Documents\OrderDocument->render_template() 5 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocument.php(1567): WPO\IPS\Documents\OrderDocument->get_html() 6 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Documents/OrderDocument.php(1634): WPO\IPS\Documents\OrderDocument->get_pdf() 7 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Main.php(517): WPO\IPS\Documents\OrderDocument->output_pdf() 8 /public_html/wp-includes/class-wp-hook.php(324): WPO\IPS\Main->generate_document_ajax() 9 /public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 10 /public_html/wp-includes/plugin.php(517): WP_Hook->do_action() 11 /public_html/wp-admin/admin-ajax.php(192): do_action() 12 {main}

    • This topic was modified 9 months, 2 weeks ago by moonwalk.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter moonwalk

    (@j0321)

    I’ve just updated to the latest version – and the order that was having the issue still wouldn’t let me re-generate the PDF invoice – FYI.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @j0321,

    Are you by any chance using the Object Cache Pro plugin? If so, can you deactivate it and try again?

    Thread Starter moonwalk

    (@j0321)

    Just disabled it – and it works.

    May I know why, please- was this a known issue? Object Cache Pro is essential for this WooCommerce setup.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    My apologies for the inconveniences, @j0321:

    Please note that we NEVER delete any posts, but this is made by the forums moderators when the message doesn’t follow the guidelines or when the spam filter put it on hold temporarily. That said, to be sure what happened, I have asked the moderators, and they said it was the second reason. Therefore, they have deleted the second topic and keep this one to avoid duplication.

    Back to the conversation, the root cause is that the “Object Cache Pro” plugin, appears to cache order objects incompletely. Specifically, refund objects end up as null. So, when the method tries to access data from those objects, it fails.

    This was reported previously by another users, but it’s something they need to fix in their code base. Please contact them and share this topic with them, so they can understand what’s happening and work in consequence.

    Thread Starter moonwalk

    (@j0321)

    Hi, thanks for the speedy reply.

    No – I never doubted that my post(s) got removed by you/plugin devs, I was certain that it was by the forum mods (after I supplied an additional screenshot to the thread which triggered a manual moderation). Apololies for any misunderstanding.

    I see. So whenever an order has a refund action being performed while Object Cache Pro is active, then this problem would occur?

    I’ll reach out to their support and give it a try then.

    Much apperciated.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    I see. So whenever an order has a refund action being performed while Object Cache Pro is active, then this problem would occur?

    Yes, and I’m afraid that would continue happening, if you continue using Object Cache Pro, until they apply a fix for this.

    Please let me know if you receive any news from them, so we can inform other users as well!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Fatal Error’ is closed to new replies.