Warning: Creating default object from empty value in Enfold theme

Hey
I am not 100% sure, if this is the same error issue.
It looks like it, but I apologize in advance if it is not!

But a few days ago I updated my website https://thomaspaludan.dk with a few minor things. I experienced no problems at all.
But today, when I go to my website, I get this text above my website:

Warning : Creating default object from empty value in /var/www/thomaspaludan.dk/public_html/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/slideshow_layerslider/slideshow_layerslider.php on line 28

And when I try to enter WordPress through https://thomaspaludan.dk/wp-admin/ I do not get a login box, but just a blank page with a bunch of error lines.
I can’t enter WordPress to fix anything.

This is pretty critical.
Do you have any idea, what the problem is and how to fix it?

Thanks,
Thomas

Hi @ThomasPaludan,

I moved your post to its own thread since it wasn’t quite the same error.

It looks like you have debugging enabled in your wp-config.php file. Generally, these warnings shouldn’t appear on your website because they could potentially leak sensitive information.

Check your wp-config.php file and change WP_DEBUG to false, like this:

define('WP_DEBUG', false);

After you do that, the warnings should go away, and you should have no issues logging into the admin dashboard. Be sure to update Enfold to the latest version once you get in. The warnings aren’t serious – nothing is broken – but they have been fixed in an update from what I can see.

Let us know how it goes or if you need any help :slight_smile:

1 Like

Hi again

Where do I find that file on my Mac?
I can’t seem to find it.

Thanks,
Thomas

Hi again

One more thing:
Is it really possible, that debugging has been enabled in the config file, when I have not accessed that config file - ever - and when the website worked perfectly a few days ago?

I am kind of having some concerns about how this happened. I have never experienced anything like this - not even being able to log in to my website.
Plus, I found, that though I usually create my own websites and have total control over passwords etc, I actually do not have any information on any FTP clients used when creating this particular website.

So I am hoping, that this is an easy fix, since I can’t understand where this error even came from. Usually errors come when you work on the website, not out of the blue.

Cheers,
Thomas

Hi.
That file (wp-config.php) isn’t on your Mac, it’s on your server. Enter your server from your Hosting panel, in file manager, or through FTP and within your domain, you will find the file wp-config.php

1 Like

Awesome, thanks, found it :+1:

Hi
I checked it now, and it was already set to false - see screenshot.

So what else can I do?

If that’s the case, then it looks like your web hosting company has configured their server to display errors by default, which is generally considered insecure. If these warnings seemingly came out of nowhere, then the most likely culprit is that your web host upgraded you to a newer version of PHP where this warning became more prevalent.

They’re not sounding very production-friendly. I would tell you to expect more cases like this in the future with them. That’s why it’s important that we hide these warnings so they don’t interrupt anything when they occur.

  • You should contact your host, and ask them to disable “display_errors” so warnings and errors aren’t shown publicly on your website.

In the mean time, let’s get you logged in so you can update the theme and fix the underlying bug.

The reason /wp-admin/ shows as a blank page is because it’s trying to redirect you to login. But it’s unable to redirect you because a warning was printed to the page (this is just a limitation of PHP, it needs to redirect before any text is printed). The bottom two warnings are actually about this.

This means that if you successfully get your web host to disable “display_errors”, everything will resume working as normal – the warnings will disappear, and /wp-admin/ will stop looking blank. Anyways, let’s log you in manually:

You should be able to access the admin dashboard at this point. See if you’re able to update Enfold to the latest version from Dashboard > Update.

Hi again
I tried that now, but it doesn’t get me in the admin interface.
Just to clarify, what I did:

I’ve attached screenshots from the proces.

What can be the issue here, since your guidance doesn’t seem to work for me?

Actually, not sure what I was thinking. Cookies are sent to the browser the same way as redirects, i.e. they won’t work until you silence the warnings.

So you’re going to have to contact your web host and get the warnings suppressed first.

GOOD NEWS!
I logged into my webhost and found the .htaccess file and put in a line of text to disable display_errors.
And that’s it - that worked!
I can now access the admin interface, and my website looks normal again.

Thank you so much :blush:

Cheers,
Thomas

1 Like

Great!

For future reference, if your website ever does stop working while errors are disabled, the proper way to find the errors would be to change that “WP_DEBUG” flag to true – the line you put in .htaccess should stay permanently.

Cheers!

Okay - not sure exactly how to do that - what that means?