WordPress.org

Support

Support » Plugins and Hacks » User Meta Manager » [Resolved] UMM form save does not work for checkboxes

[Resolved] UMM form save does not work for checkboxes

Viewing 15 replies - 1 through 15 (of 16 total)
  • Ok this is a bug and I fixed it myself. Please include in the next release!

    The issue was not considering, that empty checkboxes return nothing and need to be saved as well.

    Here what needs to be changed:
    File user-meta-manager.php
    Lines from 1734 to 1741:

    CHANGE FROM:

    foreach($show_fields as $field => $field_name):
    if(isset($_POST[$field_name]) && array_key_exists($field_name, $umm_data)):
    $posted_value = addslashes(htmlspecialchars(trim($_POST[$field_name])));
    $val = (is_numeric($posted_value)) ? sprintf(“%d”, $posted_value) : sprintf(“%s”, $posted_value);
    $output .= $field_name . ” = ” . $val . “\n”;
    update_user_meta($current_user->ID, $field_name, $val);
    endif;
    endforeach;

    CHANGE TO:

    foreach($show_fields as $field => $field_name):
    $posted_value = (isset($_REQUEST[$field_name])) ? addslashes(htmlspecialchars(trim($_REQUEST[$field_name]))) : ”;
    $val = (is_numeric($posted_value)) ? sprintf(“%d”, $posted_value) : sprintf(“%s”, $posted_value);
    $output .= $field_name . ” = ” . $val . “\n”;
    update_user_meta($current_user->ID, $field_name, $val);
    endforeach;

    Plugin Author President McCheese

    @jason-lau

    Hi,

    Thanks for the report and fix.

    Now, every time i hit update on a user all the checked boxes become unchecked!?!?!?

    please help

    Plugin Author President McCheese

    @jason-lau

    @aous77, where is this happening? In the user profile editor?

    Plugin Author President McCheese

    @jason-lau

    This should be fixed in version 2.2.6.

    i just made sure and downloaded the latest version again. it is still happening.

    i’m running WP 3.5.1 on PHP 5.4.0 / 32Bit OS.

    ok here is something odd, even though the plugin version says 2.2.7 on the plugin page it still says 2.2.5 on the bottom of the user meta manager page. does that help?

    Plugin Author President McCheese

    @jason-lau

    ok here is something odd, even though the plugin version says 2.2.7 on the plugin page it still says 2.2.5 on the bottom of the user meta manager page.

    You’re still using an old version, or it did not update correctly. Deactivate the plugin, delete it, and reinstall it.

    wouldn’t that permanently delete the data? or is that safe?

    Plugin Author President McCheese

    @jason-lau

    That depends on your settings. If you haven’t opted to delete all of the plugin’s data, then the data should be carried-over to the next version.

    Plugin Author President McCheese

    @jason-lau

    If you’re concerned with data loss, backup your website and database before making changes.

    Plugin Author President McCheese

    @jason-lau

    If you’re concerned with data loss, backup your website and database before making changes.

    You know, worse case scenario?

    OK, now it displays 2.2.7 at the bottom, YAY!, but the issue still persists. when i hit update on the wp-admin/profile.php it clears all the “custom check box fields”.

    Plugin Author President McCheese

    @jason-lau

    I would have to look at your configuration.

    I’ve tested it and can’t reproduce this issue in version 2.2.7.

    Have you tested it using a clean install of WordPress on the same server?

    Ok I downloaded the latest wp and plugin and preformed the clean install
    I am still getting the issue on the same server and on an additional test server.
    What configurations are you running? I don’t mind replicating it.

    Plugin Author President McCheese

    @jason-lau

    Set me up a temporary login on your test site and I will troubleshoot it.
    You can send me the login credentials at –
    http://websitedev.biz/contact/

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘[Resolved] UMM form save does not work for checkboxes’ is closed to new replies.
Skip to toolbar