Title: Reporting fatal error
Last modified: August 28, 2024

---

# Reporting fatal error

 *  Resolved [robwebfx](https://wordpress.org/support/users/robwebfx/)
 * (@robwebfx)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/reporting-fatal-error/)
 * We’re using this plugin in conjunction with [https://wordpress.org/plugins/print-invoices-packing-slip-labels-for-woocommerce/](https://wordpress.org/plugins/print-invoices-packing-slip-labels-for-woocommerce/).
 * We’re using Woo’s API to programmatically create orders; however, these calls
   are failing due to the following error:
 *     ```wp-block-code
       [28-Aug-2024 21:05:10 UTC] PHP Fatal error:  Uncaught Error: Call to a member function children() on null in /home/example/public_html/wp-content/plugins/mpdf-addon-for-pdf-invoices/wt-woocommerce-packing-list-mpdf.php:301Stack trace:#0 /home/example/public_html/wp-includes/class-wp-hook.php(324): Wt_Pklist_Mpdf_Addon->alter_final_order_template_html('<div class="wft...', 'invoice', Object(Automattic\WooCommerce\Admin\Overrides\Order), NULL, NULL, true)#1 /home/example/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters('<div class="wft...', Array)#2 /home/example/public_html/wp-content/plugins/print-invoices-packing-slip-labels-for-woocommerce/admin/modules/customizer/customizer.php(1186): apply_filters('wt_pklist_alter...', '<div class="wft...', 'invoice', Object(Automattic\WooCommerce\Admin\Overrides\Order), NULL, NULL, true)#3 /home/example/public_html/wp-content/plugins/print-invoices-packing-slip-labels-for-woocommerce/public/modules/invoice/invoice.php(1784): Wf_Woocommerce_Packing_List_Customizer->generate_template_html('<div class="wft...', 'invoice', Object(Automattic\WooCommerce\Admin\Overrides\Order))#4 /home/example/public_html/wp-content/plugins/print-invoices-packing-slip-labels-for-woocommerce/public/modules/invoice/invoice.php(1725): Wf_Woocommerce_Packing_List_Invoice->generate_order_template_for_single_order(98068, 'Invoice_98068', '<div class="wft...', '')#5 /home/example/public_html/wp-content/plugins/print-invoices-packing-slip-labels-for-woocommerce/public/modules/invoice/invoice.php(1503): Wf_Woocommerce_Packing_List_Invoice->generate_order_template(Array, 'Invoice_98068')#6 /home/example/public_html/wp-includes/class-wp-hook.php(324): Wf_Woocommerce_Packing_List_Invoice->add_email_attachments(Array, Object(wf_order), 98068, 'new_order')#7 /home/example/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)#8 /home/example/public_html/wp-content/plugins/print-invoices-packing-slip-labels-for-woocommerce/admin/class-wf-woocommerce-packing-list-admin.php(270): apply_filters('wt_email_attach...', Array, Object(wf_order), 98068, 'new_order')#9 /home/example/public_html/wp-includes/class-wp-hook.php(326): Wf_Woocommerce_Packing_List_Admin->add_email_attachments(Array, 'new_order', Object(wf_order))#10 /home/example/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)#11 /home/example/public_html/wp-content/plugins/woocommerce/includes/emails/class-wc-email.php(477): apply_filters('woocommerce_ema...', Array, 'new_order', Object(WC_Order), Object(WC_Email_New_Order))#12 /home/example/public_html/wp-content/plugins/woocommerce/includes/emails/class-wc-email-new-order.php(112): WC_Email->get_attachments()#13 /home/example/public_html/wp-includes/class-wp-hook.php(324): WC_Email_New_Order->trigger(98068, Object(WC_Order))#14 /home/example/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)#15 /home/example/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)#16 /home/example/public_html/wp-content/plugins/woocommerce/includes/class-wc-emails.php(172): do_action_ref_array('woocommerce_ord...', Array)#17 /home/example/public_html/wp-includes/class-wp-hook.php(324): WC_Emails::send_transactional_email(Array, Object(WC_Order))#18 /home/example/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)#19 /home/example/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)#20 /home/example/public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php(420): do_action('woocommerce_ord...', 98068, Object(WC_Order))#21 /home/example/public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php(253): WC_Order->status_transition()#22 /home/example/public_html/wp-content/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-orders-controller.php(226): WC_Order->save()#23 /home/example/public_html/wp-content/plugins/woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-crud-controller.php(191): WC_REST_Orders_Controller->save_object(Object(WP_REST_Request), true)#24 /home/example/public_html/wp-content/plugins/woocommerce-zapier/src/TaskHistory/Listener/APIListenerTrait.php(50): WC_REST_CRUD_Controller->create_item(Object(WP_REST_Request))#25 /home/example/public_html/wp-includes/rest-api/class-wp-rest-server.php(1230): OM4\WooCommerceZapier\WooCommerceResource\Order\Controller->create_item(Object(WP_REST_Request))#26 /home/example/public_html/wp-includes/rest-api/class-wp-rest-server.php(1063): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wc-zapier/v1/o...', Array, NULL)#27 /home/example/public_html/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch(Object(WP_REST_Request))#28 /home/example/public_html/wp-includes/rest-api.php(420): WP_REST_Server->serve_request('/wc-zapier/v1/o...')#29 /home/example/public_html/wp-includes/class-wp-hook.php(324): rest_api_loaded(Object(WP))#30 /home/example/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)#31 /home/example/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)#32 /home/example/public_html/wp-includes/class-wp.php(418): do_action_ref_array('parse_request', Array)#33 /home/example/public_html/wp-includes/class-wp.php(813): WP->parse_request('')#34 /home/example/public_html/wp-includes/functions.php(1336): WP->main('')#35 /home/example/public_html/wp-blog-header.php(16): wp()#36 /home/example/public_html/index.php(17): require('/home/example...')#37 {main}  thrown in /home/example/public_html/wp-content/plugins/mpdf-addon-for-pdf-invoices/wt-woocommerce-packing-list-mpdf.php on line 301
       ```
   
 * In `/wp-content/plugins/mpdf-addon-for-pdf-invoices/wt-woocommerce-packing-list-
   mpdf.php`, could lines 301 through 308 be updated to:
 *     ```wp-block-code
       $children = $product_table_body_elm->children( 0 );if( $children ) {	foreach( $children->children() as $td_elm ) {		if( $td_elm->tag == 'td' ) {			$td_elm->style = $product_table_body_style;		}	}}
       ```
   
 * This’ll run that code only when the parent node has children and prevent the 
   fatal error.
 * Thanks!

Viewing 1 replies (of 1 total)

 *  Plugin Support [WebToffee Support](https://wordpress.org/support/users/webtoffeesupport/)
 * (@webtoffeesupport)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/reporting-fatal-error/#post-17985009)
 * Hi [@robwebfx](https://wordpress.org/support/users/robwebfx/),
 * Thank you for bringing this issue to our attention.
 * We have taken note of the solution you provided. We will incorporate these changes
   in the upcoming release of the plugin to address the reported issue. Thanks for
   your input.

Viewing 1 replies (of 1 total)

The topic ‘Reporting fatal error’ is closed to new replies.

 * ![](https://ps.w.org/mpdf-addon-for-pdf-invoices/assets/icon-256x256.png?rev=
   2598007)
 * [mPDF add-on for RTL and Unicode Support](https://wordpress.org/plugins/mpdf-addon-for-pdf-invoices/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mpdf-addon-for-pdf-invoices/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mpdf-addon-for-pdf-invoices/)
 * [Active Topics](https://wordpress.org/support/plugin/mpdf-addon-for-pdf-invoices/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mpdf-addon-for-pdf-invoices/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mpdf-addon-for-pdf-invoices/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [WebToffee Support](https://wordpress.org/support/users/webtoffeesupport/)
 * Last activity: [1 year, 8 months ago](https://wordpress.org/support/topic/reporting-fatal-error/#post-17985009)
 * Status: resolved