NO BUG: Total white screen when trying to edit template

Background

Host: Hostinger (v2.2.0)
Wordpress: 6.5.2
Bricks: 1.9.7.1

Modern Events Calendar: 6.9.0
MEC Advanced Organizer: 1.3.2

Other Plugins installed and activated: Advanced Custom Fields PRO, Contact Form 7, MEC Advanced Location, MEC Advanced Speaker, Relevanssi, Relevanssi Live Ajax Search, Site Kit by Google, Social Feed Gallery, Social Icons Widget & Block by WPZOOM, WP Grid Builder - V2, WP Grid Builder - Bricks, WP Grid Builder - Map Facet

Situation
I setup a template to use for populating information from posts and it worked flawlessly. However, two days ago, I installed Modern Events Calendar and the Advanced Organizer add-on. One of the features is being able to put a shortcode for the advanced organizer on a page. I put it on the original template and it worked great.

However, the next morning, when I went in to edit the page, and it was an entire white screen. The Bricks Builder didn’t even show up.

I recreated the template with the shortcode and things worked fine again.

I woke up this morning and the page is entirely white again. I can’t figure out what could possibly be happening overnight.

Does anyone have any idea on what could be the issue?

  • If I deactivate the ā€œMEC Advanced Organizerā€ plug-in, it works fine but the shortcode them doesn’t work.

If I deactivate the ā€œMEC Advanced Organizerā€ plug-in, go into the template and turn off shortcode render preview for the short-code, then activate the plug-in, I can edit the template just fine. But I turn on the shortcode render preview, exit the template, and try to edit it again; white screen.

Hostinger offers LiteSpeed’s advanced cache-engine but that is turned off.

Additional details

When I choose to Edit with Bricks for the template, this is the URL for the white screen:
https://runarizona.com/template/run-club-details/?bricks=run

I tried opening a page that uses the template and it loads fine.

I tried reinstalled both MEC and the add-on and it reset some of the code changes I made for the shortcode styling but didn’t fix the actual issue.

When I turned on debug mode, it populates with this every time I try to edit the template with Bricks:

[15-Apr-2024 20:28:19 UTC] PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, WP_Error given in /home/u233369897/domains/runarizona.com/public_html/wp-content/plugins/mec-advanced-organizer/core/organizerWidget/frontend.php:97
Stack trace:
#0 /home/u233369897/domains/runarizona.com/public_html/wp-content/plugins/mec-advanced-organizer/core/organizerWidget/frontend.php(97): count()
#1 /home/u233369897/domains/runarizona.com/public_html/wp-includes/shortcodes.php(433): MEC_Advanced_Organizer\Core\OrganizerWidget\MEC_Advanced_Organizer_OrganizerWidget_Frontend::single_organizer_content()
#2 [internal function]: do_shortcode_tag()
#3 /home/u233369897/domains/runarizona.com/public_html/wp-includes/shortcodes.php(273): preg_replace_callback()
#4 /home/u233369897/domains/runarizona.com/public_html/wp-content/themes/bricks/includes/elements/shortcode.php(96): do_shortcode()
#5 /home/u233369897/domains/runarizona.com/public_html/wp-content/themes/bricks/includes/elements/base.php(2298): Bricks\Element_Shortcode->render()
#6 /home/u233369897/domains/runarizona.com/public_html/wp-content/themes/bricks/includes/ajax.php(371): Bricks\Element->init()
#7 /home/u233369897/domains/runarizona.com/public_html/wp-content/themes/bricks/includes/builder.php(2230): Bricks\Ajax::render_element()
#8 /home/u233369897/domains/runarizona.com/public_html/wp-content/themes/bricks/includes/builder.php(2134): Bricks\Builder::query_content_type_for_elements_html()
#9 /home/u233369897/domains/runarizona.com/public_html/wp-content/themes/bricks/includes/builder.php(287): Bricks\Builder::builder_data()
#10 /home/u233369897/domains/runarizona.com/public_html/wp-includes/class-wp-hook.php(324): Bricks\Builder->enqueue_scripts()
#11 /home/u233369897/domains/runarizona.com/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#12 /home/u233369897/domains/runarizona.com/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#13 /home/u233369897/domains/runarizona.com/public_html/wp-includes/script-loader.php(2265): do_action()
#14 /home/u233369897/domains/runarizona.com/public_html/wp-includes/class-wp-hook.php(324): wp_enqueue_scripts()
#15 /home/u233369897/domains/runarizona.com/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#16 /home/u233369897/domains/runarizona.com/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#17 /home/u233369897/domains/runarizona.com/public_html/wp-includes/general-template.php(3050): do_action()
#18 /home/u233369897/domains/runarizona.com/public_html/wp-content/themes/bricks/header.php(7): wp_head()
#19 /home/u233369897/domains/runarizona.com/public_html/wp-includes/template.php(810): require_once('/home/u23336989...')
#20 /home/u233369897/domains/runarizona.com/public_html/wp-includes/template.php(745): load_template()
#21 /home/u233369897/domains/runarizona.com/public_html/wp-includes/general-template.php(48): locate_template()
#22 /home/u233369897/domains/runarizona.com/public_html/wp-content/themes/bricks/template-parts/builder.php(2): get_header()
#23 /home/u233369897/domains/runarizona.com/public_html/wp-includes/template-loader.php(106): include('/home/u23336989...')
#24 /home/u233369897/domains/runarizona.com/public_html/wp-blog-header.php(19): require_once('/home/u23336989...')
#25 /home/u233369897/domains/runarizona.com/public_html/index.php(17): require('/home/u23336989...')
#26 {main}
  thrown in /home/u233369897/domains/runarizona.com/public_html/wp-content/plugins/mec-advanced-organizer/core/organizerWidget/frontend.php on line 97

Hi
I didn’t took the time to read through your article, but the description might be related to those known issues:

Thank you. Unfortunately, I don’t even get the editor. It’s a completely white screen.

The cause of the issue is on the first line of the error log.

it’s due the count() function found in …/wp-content/plugins/mec-advanced-organizer/core/organizerWidget/frontend.php

It seems that that shortcode from the ā€˜Advanced Organizer’ can’t be rendered inside the builder without causing a fatal PHP error, it’s expecting some variable ā€˜$value’ to be an array, and for some reason when viewing in the builder, it’s not. So when trying to count the array, there’s an error.

Bricks won’t be able to load any content in the builder if there’s a fatal PHP error. To find the root cause of the PHP error, you’re probably best to go to the Advanced Organizer support team, find out why the shortcode can’t be rendered in this situation and provide them access. I doubt it can be resolved from the Bricks side of things.

Some shortcodes come with an extra parameters to help them work better in builders, like ā€˜visual_builder=true’ or similar i’ve seen before in forms etc, where they purposely change the output specifically for inside builders.

The short term solution, which you mentioned, is to enable the ā€˜Don’t render in builder’ in the shortcode element, which will prevent it.

(side note - i’m not part of the Bricks team, just saw your post and thought i’d comment as

1 Like

Hi Matthew,
Thanks so much for your report, and welcome to the forum!

As David already mentioned (thanks, mate), it’s best to contact plugin support, as the fatal error is caused by the plugin. If we can support the plugin devs in any way, they can always contact us by mail at help@bricksbuilder.io.

Best regards,
timmse