soflyy / breakdance-bugs

Bug reports from Breakdance users.
42 stars 6 forks source link

Critical Error when adding the 'Cart Empty Message' element to the cart page #1134

Open lockedm opened 4 months ago

lockedm commented 4 months ago

Breakdance v2.0

When creating a Cart page and using the individual cart elements, when the 'Cart Empty Message' is added to the page, a WP Critical error is generated when you then exit from BD and go to WP. From WP, if you 'edit' the cart page you get the error as well. You can 'edit with breakdance' to get in to the page.

From WP Debug:

Fatal error: Uncaught Error: Call to a member function is_empty() on null in /home/genius/public_html/wp-content/plugins/breakdance/subplugins/breakdance-woocommerce/builders/cart.php:63 Stack trace: #0 /home/genius/public_html/wp-content/plugins/breakdance/subplugins/breakdance-elements/elements/Woo_Cart_Empty_Message/ssr.php(3): Breakdance\WooCommerce\CartBuilder\emptyMessage() #1 /home/genius/public_html/wp-content/plugins/breakdance/plugin/elements/Element.class.php(244): include('/home/genius/pu...') #2 /home/genius/public_html/wp-content/plugins/breakdance/plugin/render/renderer.php(481): Breakdance\Elements\Element::ssr() #3 /home/genius/public_html/wp-content/plugins/breakdance/plugin/render/renderer.php(878): Breakdance\Render\getInnerHtml() #4 /home/genius/public_html/wp-content/plugins/breakdance/plugin/render/renderer.php(1280): Breakdance\Render\getHtml() #5 /home/genius/public_html/wp-content/plugins/breakdance/plugin/render/renderer.php(1236): Breakdance\Render_render() #6 /home/genius/public_html/wp-content/plugins/breakdance/plugin/render/renderer.php(237): Breakdance\Render_render() #7 /home/genius/public_html/wp-content/plugins/breakdance/plugin/render/renderer.php(197): Breakdance\Render\getRenderedNodes() #8 /home/genius/public_html/wp-content/plugins/breakdance/plugin/render/renderer.php(46): Breakdance\Render\getRenderedPost() #9 /home/genius/public_html/wp-content/plugins/breakdance/plugin/actions_filters/the_content.php(99): Breakdance\Render\render() #10 /home/genius/public_html/wp-includes/class-wp-hook.php(324): Breakdance\ActionsFilters\replace_the_content_with_breakdance_content() #11 /home/genius/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters() #12 /home/genius/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(1871): apply_filters() #13 /home/genius/public_html/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(575): WP_REST_Posts_Controller->prepare_item_for_response() #14 /home/genius/public_html/wp-includes/rest-api/class-wp-rest-server.php(1230): WP_REST_Posts_Controller->get_item() #15 /home/genius/public_html/wp-includes/rest-api/class-wp-rest-server.php(1063): WP_REST_Server->respond_to_request() #16 /home/genius/public_html/wp-includes/rest-api.php(547): WP_REST_Server->dispatch() #17 /home/genius/public_html/wp-includes/rest-api.php(2925): rest_do_request() #18 [internal function]: rest_preload_api_request() #19 /home/genius/public_html/wp-includes/block-editor.php(753): array_reduce() #20 /home/genius/public_html/wp-admin/edit-form-blocks.php(80): block_editor_rest_api_preload() #21 /home/genius/public_html/wp-admin/post.php(187): require('/home/genius/pu...') #22 {main} thrown in /home/genius/public_html/wp-content/plugins/breakdance/subplugins/breakdance-woocommerce/builders/cart.php on line 63