DUPLICATE: Element linked to a deleted taxonomy causes a fatal error

I found this error while working on a site and manage to replicate it on a fresh test site using Bricks Playground.

Steps to reproduce:

  1. Create a new Post category.
  2. Edit any page in Bricks, then add an element which you can add a link (Div / Button)
  3. Link to the category. Eg. screenshot below:
    image
  4. Delete the Post category.
  5. Reload frontend page or editor. Fatal error happens.

I’ve tested with 2 different elements. The Div link of the deleted taxonomy still allows you to access the editor. This is how it looks like in the editor:

image

But the Button link of the deleted taxonomy causes a fatal error in the editor too. The page and editor are both inaccessible.

Below is the fatal error log:

Fatal error: Uncaught Error: Object of class WP_Error could not be converted to string in /home/website/wp-includes/formatting.php:1096 Stack trace: 
#0 /home/website/wp-includes/formatting.php(4695): wp_check_invalid_utf8() 
#1 /home/website/wp-content/themes/bricks/includes/elements/base.php(2209): esc_attr() 
#2 /home/website/wp-content/themes/bricks/includes/elements/container.php(935): Bricks\Element->render_attributes() 
#3 /home/website/wp-content/themes/bricks/includes/elements/base.php(2395): Bricks\Element_Container->render() 
#4 /home/website/wp-content/themes/bricks/includes/frontend.php(564): Bricks\Element->init() 
#5 /home/website/wp-content/themes/bricks/includes/elements/container.php(948): Bricks\Frontend::render_element() 
#6 /home/website/wp-content/themes/bricks/includes/elements/base.php(2395): Bricks\Element_Container->render() 
#7 /home/website/wp-content/themes/bricks/includes/frontend.php(564): Bricks\Element->init() 
#8 /home/website/wp-content/themes/bricks/includes/elements/container.php(948): Bricks\Frontend::render_element() 
#9 /home/website/wp-content/themes/bricks/includes/elements/base.php(2395): Bricks\Element_Container->render() 
#10 /home/website/wp-content/themes/bricks/includes/frontend.php(564): Bricks\Element->init() 
#11 /home/website/wp-content/themes/bricks/includes/elements/container.php(948): Bricks\Frontend::render_element() 
#12 /home/website/wp-content/themes/bricks/includes/elements/base.php(2395): Bricks\Element_Container->render() 
#13 /home/website/wp-content/themes/bricks/includes/frontend.php(564): Bricks\Element->init() 
#14 /home/website/wp-content/themes/bricks/includes/elements/container.php(948): Bricks\Frontend::render_element() 
#15 /home/website/wp-content/themes/bricks/includes/elements/base.php(2395): Bricks\Element_Container->render() 
#16 /home/website/wp-content/themes/bricks/includes/frontend.php(564): Bricks\Element->init() 
#17 /home/website/wp-content/themes/bricks/includes/frontend.php(663): Bricks\Frontend::render_element() 
#18 /home/website/wp-content/themes/bricks/includes/frontend.php(913): Bricks\Frontend::render_data() 
#19 /home/website/wp-content/themes/bricks/page.php(7): Bricks\Frontend::render_content() 
#20 /home/website/wp-includes/template-loader.php(106): include('...') 
#21 /home/website/wp-blog-header.php(19): require_once('...') 
#22 /home/website/index.php(17): require('...') 
#23 {main} thrown in /home/website/wp-includes/formatting.php on line 1096

Hi,

we know about this issue and it was solved in 1.11 beta. If you can, can you try 1.11 beta, and let me know if you can reproduce this error there also? I think you will not be able to, as we solved it here:

Thanks,
Matej

Hi @Matej, I can confirm that the issue is not present in 1.11 beta. Thanks.

Perfect, thank you :slight_smile:

I’ll just mark this topic as a duplicate and we will consider the one in the link above as an original.

Thank you again for confirming.
Matej