• Resolved mgiulio

    (@giuliom)


    Hello Sormano,

    here’s a quick patch to suppress them(just swapped the isset() checks):


    @@ -87,12 +87,12 @@ class Wpml_Widgets {
    <select id='wpml_language' name='wpml_language'><?php
    foreach ( $languages as $language ) :

    - $selected = ( $language['language_code'] == $instance['wpml_language'] ) ? 'SELECTED' : null;
    + $selected = ( isset( $instance['wpml_language']) && $language['language_code'] == $instance['wpml_language'] ) ? 'SELECTED' : null;
    ?><option <?php echo $selected; ?> value='<?php echo $language['language_code']; ?>'><?php echo $language['native_name']; ?></option><?php

    endforeach;

    - $selected = ( 'all' == $instance['wpml_language'] || !isset( $instance['wpml_language'] ) ) ? 'SELECTED' : null;
    + $selected = ( !isset( $instance['wpml_language'] ) || 'all' == $instance['wpml_language'] ) ? 'SELECTED' : null;
    ?>
    <option <?php echo $selected; ?> value='all'><?php _e( 'All Languages', 'wpml-widgets' ); ?></option>
    </select></p>

    Thanky you for this smart plugin,
    mg

    https://www.ads-software.com/plugins/wpml-widgets/

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

    (@sormano)

    Hey,

    Thanks for reporting!
    Where did you find the PHP warnings?

    I’ll look into this probably this weekend ??

    Cheers,
    Jeroen

    Thread Starter mgiulio

    (@giuliom)

    On the wp-admin/widgets.php page several warnings about the undefined array index $instance[‘wpml_language’] were generated.

    Thanks Jeroen,
    mg

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    I just pushed an update which should fix it. Let me know how it works out for you.

    Thanks again for reporting as I didn’t notice it at first ??

    Jeroen

    Thread Starter mgiulio

    (@giuliom)

    They are gone now.

    Thank you,
    mg

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP warnings’ is closed to new replies.