This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 17 replies, has 2 voices.

Last updated by Yvette 1 year ago.

Assigned support staff: Yvette.

Author Posts
September 4, 2018 at 9:28 pm

danielZ-30

I am trying to: I'm using the latest Avada Theme and it allows me to add additional widget sections. Since some of the later WPML Updates adding a new widget section fails and removes all widgets from the database.

Link to a page where the issue can be seen: hidden link

I expected to see: Additional widget section added in Appearance > Widgets.

Instead, I got: No widgets at all.

I reported the problem to the Avada developers which sent me the following error. They told me, it's the problem of WPML.


<b>Fatal error</b>:  Uncaught Error: Call to a member function slug() on array in /var/www/silentyachts.ziegenberg.at/wordpress/wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-widget.php:76
Stack trace:
#0 /var/www/silentyachts.ziegenberg.at/wordpress/wp-includes/class-wp-widget.php(507): WPML_LS_Widget->form(Array)
#1 /var/www/silentyachts.ziegenberg.at/wordpress/wp-admin/includes/widgets.php(243): WP_Widget->form_callback(Array)
#2 /var/www/silentyachts.ziegenberg.at/wordpress/wp-includes/widgets.php(743): wp_widget_control(Array, Array)
#3 /var/www/silentyachts.ziegenberg.at/wordpress/wp-admin/includes/widgets.php(100): dynamic_sidebar('wp_inactive_wid...')
#4 /var/www/silentyachts.ziegenberg.at/wordpress/wp-admin/widgets.php(421): wp_list_widget_controls('wp_inactive_wid...', 'Inactive Widget...')
#5 {main}
thrown in <b>/var/www/silentyachts.ziegenberg.at/wordpress/wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-widget.php</b> on line <b>76</b><br />

September 5, 2018 at 10:49 am #2706487

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello

I was able to deploy the duplicator of your site on my local server.

1. Please send detailed steps how to replicate the error that you are having?
Be as detailed as possible and include screenshots where you think it will clarify steps.

You can assume that my knowledge of new Avada features is low.

September 7, 2018 at 5:38 pm #2715619

danielZ-30

Steps to reproduce:

1. In wp-admin I navigate to Appearance -> Widgets and click on "Add New Widget Section".
2. A modal javascript windows appears asking to the widget section name
3. I enter "test-widget" and click "ok"
4. nothing happens
5. in the web console (firefox and chrome) an error is logged

ReferenceError: sack is not defined

You can create one additional widget section and now all the widgets sections are gone, the widgets are listed under "inactive widgets" and the mentioned error is shown. The site (mega menu) is now partially broken and I need to repair my website from a backup.

September 8, 2018 at 2:35 pm #2716867

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello

I was able to replicate the issue on your duplicated site exactly as you described.

I then tried installing the same version of Avada and defined widget sections on this new installation. With this setup, I could not replicate the problem (see images)

Could you tell me more about the other widget sections on your site? Were they created previously to WPML being installed? Were they part of a template..were the imported?

I am interested in trying to provoke the same type of failure that you are experiencing on your site.

Thanks for any information you can provide on the other widget sections.

September 8, 2018 at 5:21 pm #2717089

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello

I was able to determine that this behaviour is linked to the menu-item widgets with images. I tried to create a menu with menu items that link to widget sections...but I am unable to see any option to configure mega-menu options on a menu item.

Would you be able to tell me what theme options need to be set and how to go about creating a menu item that will allow me to link to a wdget-section? with this, I believe I can recreate the issue on my local server.
THanks for your help in this.

September 8, 2018 at 5:35 pm #2717091

danielZ-30

Hello!

Answering your questions:

Could you tell me more about the other widget sections on your site?
The widget sections are used in the avada mega menu. Each menu entry get's its own widget section assigned and each widget section has its own set of image widgets with links to the respective page and language.

Were they created previously to WPML being installed?
I can't recall exactly. I started development of this site in May 2018 and along the road more and more menu items were added, as my customer requested them. Sometime I installed WPML and I updated it several times since. Adding new widget sections worked for some time, with the last version of WPML (and it's plugins) this functionality was broken. But I sadly cannot recall which was the last working version of WPML.

Were they part of a template..were the imported?
No, they were no part of a template and they were not imported. I created them along the road of designing the webpage.

September 8, 2018 at 5:42 pm #2717094

danielZ-30

Would you be able to tell me what theme options need to be set and how to go about creating a menu item that will allow me to link to a widget-section?
I will try to create a short, comprehensive and minimal list of necessary steps to recreate an avada mega menu with widget sections.

September 8, 2018 at 6:39 pm #2717121

danielZ-30

Steps to create an Avda "Fusion Mega Menu":

  • Create a widget section with a widget image element in it
  • Create a menu with two items, one of them being a submenu-item
  • Open the menu item and click "Avada Menu Options" Button
  • Scroll down in the Avada Menu Options Modal Window and go to "Fusion Mega Menu"
  • Turn toggle "Fusion Mega Menu" to "on"
  • Click Button "Save"
  • Open the menu sub item and click "Avada Menu Options" Button
  • Scroll down in the Avada Menu Options Modal Window and go to "Mega Menu Widget Area"
  • select the previously create widget section from step one
  • Click Button "Save"
  • Click Button "Save Menu"
September 10, 2018 at 7:21 am #2718918

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Hello

Thank you for the instructions - they were helpful. I was having issues because I did not realise the mega-menu was only active for the "main" menu of the theme.

I was not able to replicate your issue on a clean installation. Howerer, I was able to find an anomaly with your widgets that can explain the behaviour although I don´t know how to fix it.

In my system, I am able to follow your steps and still create new widget sections without having the other widgets disappear. If you notice, your widgets do not show any multilingual attribute in them. This would explain why they "disappear" when the WPML module is activated.

I will need to consult with some colleagues in 2nd tier about this problem on your site and possibly escalate it.

I wanted to confirm, however, that the Avada widget sections ARE working with WPML CMS. In my opinion, if we were to understand why your existing widgets are not multilingual, then we would be able to resolve your issue entirely.

September 19, 2018 at 6:12 am #2747311

danielZ-30

Hello!

When I created this duplication of my site, the multilingual attributes for the widgets were present. And they are present in my production site. I have no idea, why they now have disappeared.

I think, it's absolutely possible, that Avada and the widget sections are working for a clean installation, it's just that along the way with updating WPML several times something broke. The question is, where's the culprit? Is it an error in the widget data structure, which is saved in the wp_options table?

greetings, Daniel

September 19, 2018 at 7:06 am #2747515

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

You wrote: "When I created this duplication of my site, the multilingual attributes for the widgets were present. And they are present in my production site"

I am only working off of the Duplicator package your provided. Is this package created from the production site?

Or is this from a different site?

If it is only my duplciator version that is affected...could you try creating another package for me to use?

THanks

September 19, 2018 at 2:25 pm #2749032

danielZ-30

Yes, this Duplicator package is based off of the actual production site.

September 20, 2018 at 7:15 am #2751098

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

Then in this case, can you try creating the Duplicator package again?

If we are not working off of the clone...then we cannot provide the correct support.

Alternatively, at shere seems to be a problem when I install the Duplicator on another server, you can use the same Duplicator package your provided and install it on your own server as a staging site where we can also do the required troubleshooting.

I wait for your decision on how to proceed.

September 22, 2018 at 5:53 pm #2757828

danielZ-30

I have provided you a current clone off of the actual production site. It's at /var/www/silentyachts.ziegenberg.at/wordpress/duplicator.zip together with a installer.php

September 24, 2018 at 1:33 pm #2760636

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Madrid (GMT+02:00)

I am opening the private area for FTP access details then.

Just to confirm, this is a different package than the one you originaly provided when you opened this ticket - right?

Thanks

The topic ‘[Closed] Uncaught Error: Call to a member function slug() on array in language-switcher’ is closed to new replies.