-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Argument #1 is not an array in /base/controls-stack.php on line 1184 #10578
Comments
Thanks, we are currently working on this issue and will update this thread when there's an update. |
I'm also receiving the same error after the latest update but I don't have Woocommerce installed on my site. The error code only appears on a certain custom post type single template in the section containing a Taxonomy Terms List widget from a 3rd party plugin (Dynamic Content for Elementor) |
I (also) noticed the same error in a third party plugin (LifterElements) after updating to 2.9.1. In my case, the error seems to happen when using the "update_control" method on a widget. For what I saw, the error happens only if I change the type of a control. For example, this will result to the error: $control = $element->get_controls( $name );
$control['type'] = \Elementor\Controls_Manager::HIDDEN;
$element->update_control( $name, $control ); But this will not: $control = $element->get_controls( $section_id );
$control['conditions'] = [
'terms' => [
[
'name' => 'render_type',
'operator' => 'in',
'value' => [ 'custom_button'],
],
]
];
$element->update_control( $section_id, $control ); I hope it will help! |
Hi, |
Hi, I had the same issue after installing the latest version of WP and Elementor. Once I activated SSL, the problem was gone. May this helps you, too? |
This seems to be a problem for many users across the board and with my current traffic and use cases of my plugins I would rather not do the test of deactivating plugins. What is the latest guys? |
Same problem. Changing:
Solves the issue, but introduces other problems. Update appreciated. |
I have this issue with Woocommerce and the Custom Add To Cart button using the Theme Builder for a Single Product Page. It consistenly occurs everywhere i add the button this page. I should add that i do not set a product to the button leaving it to "All Products" so that it dynamically implies add the current product to the cart. |
I updated the original issue to reflect the various reports about this happening regardless of the usage of the Custom Add To Cart Button or WooCommerce. Also, the link for the search about the issue in the Elementor Group only shows posts that copied and pasted the Warning in the post body, but it's actually also being reported with images. Far beyond the number of posts originally reported. |
This Problem is due to merge of array and non array variables in php 7.3 and above as per my experience. Kindly change at Line 1183. if ( ! empty( $control['dynamic'] ) { to if ( ! empty( $control['dynamic'] ) && is_array($dynamic_settings)) { Solves the issue... |
@zenstars, just tried what you suggest and it fixes the issue. |
Hi All. I am new to github and I am not an advanced coder, but I understand the basics. I do more design based work. As Jimyaghi stated above, I am also getting this error when using the Custom Add to Card button in Elementor Pro. We use WooCommerce.
Has there been a patch or update yet? |
@mikevendia It looks like the issue has been fixed in this commit (on the dev branch). I guess we need to wait for the next Elementor version for having the fix now. |
It worked, thanks! |
Worked for me, thanks. |
Not fixed in latest version! I tried on PHP 7.3 |
Elementor update 2.9.3 is fixing the issue on my side, thanks |
Elementor update 2.9.3 fixed on my side as well. Thanks, Elementor Team. |
I tried upgrade to 2.9.3 and problem is still there. Tried disable all plugins and problem remains. |
Iczz posted the fix above that worked for me - per Elementor v2.9.3 / PHP 7.0 - issue only appeared on my home page, not on any other post or page. FIX:
Kindly change at Line 1183.
|
I updated Elementor to version 2.9.3 but the issue still exists. It appears only when I use the Airi Element widget "aTheme: Blog". I am not a programmer. I only add posts to our foundation's website using elementor so I basically have no idea how to solve this and why is this happening. I hope you can help @zeinnicholas here is the link to one of the pages that shows the bug. |
pau-panda28 - you will need to pass the above info to someone (webmaster/developer) that has access to the file system via FTP or cPanel FileManager, etc. in order to edit the file causing the issue. |
For me it's only happening on the home page here: (http://wisconsinfan.com) |
Rock and roll indeed it does! Thanks! |
The problem is not solved yet. Fixed this. |
@pau-panda28 In your case I strongly suggest you contact the 3rd party developer of that widget to ask him to fix it, since there is another way to accomplish that widget functionality that isn't dependant on the Dynamic functionality that is causing the issue. |
@zeinnicholas commented on Feb 28, 2020, 4:33 PM GMT+2:
We will take a look and update you. Thanks! |
@shilo-ey Hi. When will you fix the error? I checked in version 2.9.2 of Elementor there is no error, and in version 2.9.3 the error appeared. Or tell us what plugin developers need to change in their plugins so that there is no error? Can you give a link to the page where you specify your changes so that the developers know what needs to be fixed? Thanks. |
I removed this code from the widgets that showed the error and the error does not appear.
This code is no longer used at all? I looked at the documentation examples, you removed this code from all the examples. I'm talking about these examples https://developers.elementor.com/elementor-controls/ |
Dear All, One thing I need to clear, that with my earlier fix and update to elementor 2.9.3, I did not have any error. If anyone has the same error after update to the elementor 2.9.3, please remove my fix and change line 1183 of wp-content\plugins\elementor\includes\base\controls-stack.php back to the original as mentioned below... if ( ! empty( $control['dynamic'] ) ) { Thanks... |
@zenstars When updating the Elementor to 2.9.3, the code will update itself and you do not need to manually delete it. But in version 2.9.3 the problem is not solved. |
@UrchenkoV What kind of error user have after update to ver 2.9.3. For further read : https://stackoverflow.com/questions/20131948/php-array-merge-if-not-empty |
@zenstars ...wp-content\plugins\elementor\includes\base\controls-stack.php on line 1184 |
@UrchenkoV Please change on line 1184 $dynamic_settings = array_merge( (array)$dynamic_settings, $control['dynamic'] ); This will force to convert $dynamic_settings variable to an array which removes array merge error. |
it's working 100% |
@zenstars Thanks. I did this, it solves the problem, but this method is suitable for site owners and I am a plugin developer. People install the plugin and it should work correctly, not show errors. The Elementor command should solve this problem. I solved this problem for the plugin like this: I removed this code |
This issue has been resolved in Elementor v2.9.4 Feel free to update Thanks! |
Just updated, everything is OK, thank you |
Thank you so much! Cheers! |
I am facing this issue with "wordpress": "5.4.2", "elementor":"2.9.13" and "essential-addons-for-elementor-lite":"4.0.2" |
@geekodour If you are having this issue only with an addon enabled, it means your addon is conflicting with Elementor. Contact the addon support so they can fix their conflict. If this issue persists with only Elementor and Elementor Pro enabled, then create a new issue, since this one was already closed, but remember to mention this one. |
Hi, I still getting the error. |
@Heysoulnat can you please elaborate? Maybe share your Dashboard > Elementor > System Info? |
how use this cord please help me |
Prerequisites
Description
Users have been reporting errors with WooCommerce based websites after updating to 2.9.2:
Warning: array_merge(): Argument #1 is not an array in .../wp-content/plugins/elementor/includes/base/controls-stack.php on line 1184
It has something to do with Dynamic Tags and the use of the Custom Add To Cart button inside static pages.
For more information about the issues:
https://www.facebook.com/groups/Elementors/search/?query=argument%20%231&epa=SEARCH_BOX
Steps to reproduce
WooCommerce environment:
It may only happen upon updating from a previous Elementor version to the new one.
Isolating the problem
The text was updated successfully, but these errors were encountered: