Site logo

Archived topic

Elements causes critical error

11 replies · Started by Sonja on March 4, 2022

Viewing posts 1–12 of 12

Hallo there,

I created my first Elements-Category-Page on my blog:

https://crafting-cafe.de/category/tutorials/naehen-fuer-faule/

It's a popular and big category, so I wanted to give my readers an overview on all the existing articles. Everything went fine, but some of the links I set now lead to a "critical error page", sometimes even the category-archive-page itself.

I have a similar problem with creating an author's box - which is why I don't have one :/.

The error occurs not every time and sometimes it goes away by refreshing the page. But something isn't right and maybe someone here can help me fix the problem - thank you! :]

One more question: I want the page hero only on the first category archive page, not an page 2,3 and so on. How can I configure that?

Thank you very much,
Sonja

Hi there,

Might be worth asking your host if they can enable debugging on the server, then when a critical error occurs they should be able to provide more info as to what caused it.

Excluding the element from paged instances, if you edit your Element, and check the Browser URL Field you will see ID=XX - make a note of the ID.

Now add this PHP Snippet to your site:

add_filter( 'generate_element_display', function( $display, $element_id ) {
    if ( 99 === $element_id && is_paged() ) {
        $display = false;
    }

    return $display;
}, 10, 2 );

Where you see 99 replace that with your elements ID.

Thank you, David, I will ask the host if they can help me.
Where am I supposed to insert the PHP Snippet?

Thank you,
Sonja

Hi David,
thank you very much!
I think I got it :D.
Thank you so much!!
Sonja

You're welcome

Hi David,
I'm sorry, the error occured again :/.
I don't know - I cleared the cache and added the PHP Snippet, but the "critical error"-page occurs randomly. It goes away after refreshing the page, but there must be some other bug.
I asked the host about it; they told me there is nothing. The page has PHP 8.0.
Maybe you have another idea?
Thank you, Sonja

Is the host sure they cannot provide any further details? It seems peculiar that a Critical Error occurs and they cannot get a trace on that error. Would you mind asking them again?

In the meantime lets look at some other stuff:

1. GP and WP are PHP 8.0 compatible. But not all plugins are and could cause an issue. Downgrading to PHP 7.4 may remedy a PH Version problem. See following not:

2. On the URL provided, Right Click > Inspect the page - on the Console tab you see a bunch of errors, all of which look to be related to scripts that have atomic-block-components as part of their ID. Are you using the Atomic Blocks plugin as that hasn't been updated in quite some time.

3. I notice on the URL you provided above, part of the hooked element contains a Woocommrece block, it may not be an issue but its Queries may be causing a conflict with the main loop of the archive. Might be best to remove that to test.

Hi David,
thank you very much!
I downgraded to PHP 7.4 now, and I removed the Woocommerce Block from the Element.
I don't have "Atomic Blocks plugin", so I don't know what I could do there :/. All plugins are updated.

I'll ask the host again.
Have a good day,
Sonja

I had a nose around to see what: these atomic-block-components scripts belong to and it looks like they are part of Woocommerce and their blocks. But i have never seen them on the front end before ( that i recall ).

Might be worth raising a topic with Woo support to ask what those errors are.

Hi David,

ok, thank you! I will ask. *sigh*

Thank you, Sonja

You're welcome

This archived topic is closed to new replies.