Site logo

Archived topic

Error in log files

14 replies · Started by gedosan on June 16, 2021

Viewing posts 1–15 of 15

Hi Guys

I've been told by my hosting provider to get in touch with you. In my error logs, I'm getting the following error:
PHP Warning: Invalid argument supplied for foreach() in /home/server/public_html/wp-content/themes/generatepress/inc/structure/post-meta.php on line 342

Currently my Gutenberg is broken, I can't edit, publish, select categories.

Can you help?

Thanks

Hi there,

do you have any custom functions added to your site ?

I have a few yes added via the snippets plugin (5 in all). Do you want me to paste them here?

If you can temporarily disable the snippets first to see if the error clears. If it does then you know its one of the snippets creating an issue.

Yeah tried that (twice) and didn't make any difference.

I've recently introduced a new page hero layout using a hook element that pulls in post meta (title, featured image, etc). My hunch is it's something related to that.

I've added my log in details below, as guessing you need to see what's going on. Cheers

Can you temporarily disable the Hero element you added to the Hook ?

sure - one sec

Hmm, trying to set location in the hook to nothing (was set to all posts) but all I'm getting is the updating button spinning. something is up.

Actually it just saved (now the hook is off). Hasn't made any difference. The categories and tags aren't appearing in the sidebar.

I had a look at the backend of the site.... and theres quite a lot of Hook Elements.
It may be best to get the host to Move the site to a Staging Site - where you can debug the issue without affecting the live site.

Once its on staging, you can disable ALL of the Code Snippets and then in Appearance > GeneratePress disable the Elements Module. Then test to see if the error still occurs. If it doesn't then re-enable the Elements Module to see if one of them is the cause.

Note: disabling the Elements Module won't delete the elements.

Hmm, there's actually a ton of hooks that I don't use anymore so will start with deleting those.

After all that, turns out it was an issue with my Chrome browser. Reinstalled and all ok. Sorry about that.

Ged

Glad to hear you got it resolved!

This archived topic is closed to new replies.