Support » Plugin: WPML Widgets » Error: Undefined index: wpml_language

  • Resolved ldwd

    (@ldwd)


    Hi Jeroen,

    Using the customizer while editing a page with SiteOrigin Page Builder I got this error message after saving one of the widgets:

    Notice: Undefined index: wpml_language in \wordpress\wp-content\plugins\wpml-widgets\wpml-widgets.php on line 160

    Do you have a patch?

    Thank you for this *awesome* plugin!

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    Is this happening when saving the WPML Widgets -widget, or a other widget?

    Thank you,
    Jeroen Sormani

    Hi Jeroen,

    Thanks for your fast reply.

    It happens when I save another widget (one with my page content in SiteOrigin Page Builder).

    Hope this helps!

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    I’ve investigated this a bit and I did get the error only when I didn’t select a different value at one time.
    After that it doesn’t seem to show up anymore.

    I’m not exactly sure why SiteOrigin is triggering a widget update when saving the post (that seems to be when this error is occurring) since widgets should be updated over AJAX (at least with the default behaviour).

    A check could be added, but this wouldn’t resolve any other issues that come with the SO pagebuilder (I noticed the values are not saving). Since the pagebuilder isn’t officially supported by my plugin I can’t really investigate that further.

    Hope I’m making sense there 🙂

    Have a great day!
    Jeroen Sormani

    Hey!

    Thank you for your answer.

    I don’t quite understand what you mean.

    I just tried to use the live editor in SiteOrigin Page Builder and I don’t even get the preview when opening it, the errors now displays directly in that screen.

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    Could you maybe post a screenshot? I was able to use the pagbuilder without further issues.

    Thanks,
    Jeroen

    PS. please do note that I can’t guarantee it will be fixed / made compatible as its not officially supported.

    Sure, here you go:
    Screenshot

    This time the live-editor did work at first, until I saved a widget, then I got the error again as seen in the screenshot.

    Hope you have a fix, thank you for looking in to this issue 🙂

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    Ah, that is on the front-end, right?

    I was using the editor on the page in the admin.

    If I’d add a check to the code to ensure the param is set it should remove the notices, but I doubt it would fix / ensure the things are working.
    Were you also able to get the thoughts of the devs behind the pagebuilder to see if they have ideas on why something like this would happen?

    Cheers,
    Jeroen

    Hey,

    I used the editor on the admin, but it does show the front-end (live editor, like the customizer). Does that make sense?

    I think a check could work. Let’s try it 🙂

    Thanks again!

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    Were you able to successfully use a conditional check for it?
    When I was doing that it didn’t work and still didn’t save the values set in the dropdown (making the functionality useless)

    What did SO say? I imagine they’ve encountered other plugins too that does something similar.

    Cheers,
    Jeroen

    Uhm… I didn’t check anything. Don’t know how. I was just supporting your suggestion with my “Let’s try it” 🙂

    Can you provide the code you used? I am a little familiar with php, so I could try.

    I didn’t check with SO yet, because I assumed this was an issue within your plugin. But according to you it’s most likely not?

    Thanks so far!

    Plugin Author Jeroen Sormani

    (@sormano)

    This wasn’t working for me as there are still other underlying issues (the value not saving / SO seems to call the ‘update’ function when its only loading)

    This probably is a partial caused by this widget and partial because of SO. Mainly because this widget isn’t tested outside the widget area, and they do use widgets in a different way.

    I had another language dropdown (I believe from WPML core) which also didn’t seem to save any values, which makes me believe other features that do something similar (I believe there are few others out there that add options to all widgets) that may’ve bumped into the same thing.

    I asked about SO as I can’t spend a whole lot of time to fix things for only one user (sorry!) for a incompatibility with a (unsupported) 3rd party plugin, how unfortunate that may be.

    The code for the check would look something like:

    if ( isset( $_REQUEST['wpml_language'] ) ) {
        $instance['wpml_language'] = $_POST['wpml_language'];
    }

    Cheers,
    Jeroen

    Hi Jeroen,

    I totally understand, no sorries!

    I will try this code. It’s not that important, but it would be convenient to use the live editor of SO.

    So if it doesn’t work I’m still very happy with your great plugin! 🙂

    Have a nice day!

    Hi Jeroen,

    Just so you know, your code worked for me! 🙂
    Thanks for your support!!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Error: Undefined index: wpml_language’ is closed to new replies.