WordPress.org

Ready to get started?Download WordPress

Forums

Display Widgets
[resolved] Bug for checkbox save (5 posts)

  1. Johann Wagner
    Member
    Posted 1 year ago #

    Hi,

    there is a bug I got with version 1.24.

    How to reproduce : I check one of the following checkboxes : show to logged-in users - show to not logged-in users

    What happen : if uncheck and save, it won't be saved, it remains checked

    Solution : in function "dw_update_widget_options", if $new_instance['dw_logout'] or $instance['dw_login'] is not set, nothing is saved, but 0 should be saved

    Thank you for you plugin!

    http://wordpress.org/extend/plugins/display-widgets/

  2. moedeboum
    Member
    Posted 1 year ago #

    Hi Johann,

    falls Du deutsch sprechen solltest:
    Kannst Du den genauen Code, den man ersetzen muss, bitte posten.

    English:
    Could you please post the right code in here.
    I couldnt understand your solution...

    Thank you

  3. Johann Wagner
    Member
    Posted 1 year ago #

    Hier bitte :

    display-widgets.php -> dw_update_widget_options() l. 267

    Change

    if(isset($new_instance['dw_logout']))
            $instance['dw_logout'] =  $new_instance['dw_logout'];
        if(isset($new_instance['dw_login']))
            $instance['dw_login'] = $new_instance['dw_login'];

    Into

    if(isset($new_instance['dw_logout']))
            $instance['dw_logout'] =  $new_instance['dw_logout'];
        else
            $instance['dw_logout'] =  0;
    
        if(isset($new_instance['dw_login']))
            $instance['dw_login'] = $new_instance['dw_login'];
        else
            $instance['dw_login'] = 0;
  4. moedeboum
    Member
    Posted 1 year ago #

    Vielen Dank! ;)

  5. sswells
    Member
    Plugin Author

    Posted 5 months ago #

    This has been updated in v2.0. Sorry for the delay.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.