Home Forums WoodMart support forum Fatal error in Cart Table Gutenberg block after patch 714755

Fatal error in Cart Table Gutenberg block after patch 714755

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #715229

    user67844
    Participant

    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.
    #715250

    Artem Temos
    Keymaster
    Xtemos team

    Hi there,

    Sorry for the trouble. We identified a regression in patch 714755 affecting the Cart Table block in the Gutenberg editor. We’ve replaced it with a new patch that fixes the issue: 715248.

    Please open WoodMart -> Patcher and apply patch 715248. Let us know if the editor loads without the fatal error after that.

    Kind Regards

    #715251

    user67844
    Participant

    Hi ! The new patch fixed the issue 👍
    Thanks

    #715255

    Artem Temos
    Keymaster
    Xtemos team

    You are always welcome. Feel free to contact us if you have any further questions.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Fatal error in Cart Table Gutenberg block after patch 714755’ is closed to new replies.