Elementor causing 500 error

Hey guys, I recently ran into an issue on one of my sites adding a basic field loop that is causing 500 error and breaking my elementor templates.

See here: Dropbox Capture

Here is the server errors:

Uncaught TypeError: Argument 1 passed to Elementor\Controls_Stack::sanitize_settings() must be of the type array, null given, called in /home/495230.cloudwaysapps.com/aqjhjhnvnj/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php on line 1109 and defined in /home/495230.cloudwaysapps.com/aqjhjhnvnj/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php:2414
Stack trace:
#0 /home/495230.cloudwaysapps.com/aqjhjhnvnj/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php(1109): Elementor\Controls_Stack->sanitize_settings()
#1 /home/495230.cloudwaysapps.com/aqjhjhnvnj/public_html/wp-content/plugins/elementor/includes/base/controls-stack.php(2163): Elementor\Controls_Stack->get_data()
#2 /home/495230.cloudwaysapps.com/aqjhjhnvnj/public_html/wp-content/plugins/elementor/core/base/base-object.php(142): Elementor\Controls_Stack->get_init_settings()
#3 /home/495230.cloudwaysapps.com/aqjhjhnvnj/public_html/wp-content/plugins/elementor/core/base/base-object.php

Hey there,

Thanks for letting us know! I will also test this and see how it behaves and if it’s indeed a bug, I’ll let the developers know and I will update you as soon as I get feedback from the devs. :slight_smile:

Hey Shae,
I wasn’t able to replicate your issue on my end, however, I know sometimes L&L don’t show up or don’t work as expected with Elementor the way you are displaying it, so try using the shortcode block by Elementor and in that block put your L&L template and it should look something like this: [template id="123"]

Let me know if this workaround works for you!

Thanks @emma I’ve copied my site over to a staging environment. Deactivated all plugins except for the the core ones needed and activated the elementor hello theme to eliminate any custom functions I’ve added. I did what you recommend with the shortcode, and I am still getting the 500 error.

See here: Dropbox Capture

I’m adding this to try and see if there is an issue with what I am doing with loops & logic. Just want to make sure I avoid things like this in future builds. I can provide access to this staging site if it helps.

Thank you for reporting the issue. I’m looking into where this error comes from within Elementor, and apparently users have been seeing it for a few years.

The above issues are all closed, but reading through them didn’t give any insight into how to solve it.

From the error message, it sounds like L&L’s Template widget needs to somehow pass an array value to the Elementor function Controls_Stack->sanitize_settings(). But the widget is already passing an array of default settings, as explained in their documentation for Control Settings. I guess something more is necessary, maybe an Elementor-specific filter.

Well, I’ll keep you updated when this is hopefully solved soon.

(Tagging @nicolas, in case you might know something about this Controls_Stack.)

1 Like

I can provide access to this staging site if it helps.

Sure - maybe you could send me a link in a private message on Discourse.

It would be helpful to create a Duplicator export (zip package) of the site. Would that be OK for me to install it on the staging site and export the site? That way I can download and run the site locally, and study the issue in more depth - for example, by adding debug statements in L&L and Elementor’s code, which is easier to do if they’re local files.

I’ve continued looking into this issue, and it seems to be a bug in Elementor itself.

I haven’t been able to reproduce the error, but I followed each step in the stack trace you posted. The error is coming from the Elementor class Controls_Stack. The only thing related to it in the L&L plugin is the Template control (which is distinct from Template widget and I suspect it’s not used by anyone). It’s a small piece of code based on an example in the Elementor docs, and it doesn’t do anything that could possibly cause the issue - which is that the control stack’s settings is null instead of an array.

I think the only way I can dig further is to see the issue in action, by running a local copy of the site where it’s happening.

Hi Eliot. Sorry for the late response. Where can I send you the backup directly?

Hi Shae - You can try sending it to me in a direct message on Discourse, or by email: eliot@teamtangible.com.