Hello,
Since applying patch #714755, I get a fatal error in the WordPress admin when opening the Gutenberg editor for a page/post containing the WoodMart Cart Table block.
Error message:
Call to a member function calculate_totals() on null
Full error:
Fatal error: Uncaught Error: Call to a member function calculate_totals() on null in /home/u627629359/domains/k-dental.fr/public_html/wp-content/themes/woodmart/inc/integrations/gutenberg/src/layouts/ct-table/render.php:23
Stack trace shows it happens during REST/Gutenberg preload:
WP_REST_Posts_Controller
rest_preload_api_request()
block_editor_rest_api_preload()
edit-form-blocks.php
It looks like the Cart Table block calls WC()->cart->calculate_totals() while WC()->cart is null in the admin / REST editor context.
This started after applying patch 714755.
Can you confirm if patch 714755 may cause this issue, or if an additional fix is required for:
woodmart/inc/integrations/gutenberg/src/layouts/ct-table/render.php
Suggested safeguard would be checking WC()->cart before calling calculate_totals(), and ideally avoiding this block rendering in REST/admin editor context.
Please let me know the proper official fix.
Thank you.
Attachments:
You must be
logged in to view attached files.