WordPress.org

Ready to get started?Download WordPress

Forums

User Meta Manager
[resolved] UMM form save does not work for checkboxes (17 posts)

  1. metalot
    Member
    Posted 1 year ago #

    UMM form save does not work for checkboxes.
    All wordpress and UMM versions are the recent ones.
    But it works fine for other types of usermeta fields. Any idea?

    http://wordpress.org/extend/plugins/user-meta-manager/

  2. metalot
    Member
    Posted 1 year ago #

    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;

  3. President McCheese
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Thanks for the report and fix.

  4. aous77
    Member
    Posted 1 year ago #

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

    please help

  5. President McCheese
    Member
    Plugin Author

    Posted 1 year ago #

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

  6. President McCheese
    Member
    Plugin Author

    Posted 1 year ago #

    This should be fixed in version 2.2.6.

  7. aous77
    Member
    Posted 1 year ago #

    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?

  8. President McCheese
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  9. aous77
    Member
    Posted 1 year ago #

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

  10. President McCheese
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  11. President McCheese
    Member
    Plugin Author

    Posted 1 year ago #

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

  12. President McCheese
    Member
    Plugin Author

    Posted 1 year ago #

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

    You know, worse case scenario?

  13. aous77
    Member
    Posted 1 year ago #

    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".

  14. President McCheese
    Member
    Plugin Author

    Posted 1 year ago #

    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?

  15. aous77
    Member
    Posted 1 year ago #

    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.

  16. President McCheese
    Member
    Plugin Author

    Posted 1 year ago #

    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/

  17. Coyot34
    Member
    Posted 1 year ago #

    Hello Jason,

    And great plugin, good job.

    I have the same issue with check box. After submission, chebox are set back to a null value.

    I run WordPress 3.6, and UMM 3.0.1, on a WAMP server.

    Do you find any way to solve this problem ?

    I have a second question, i want to make a "your profile" front end page. I create a page and display all the meta fields I created but how do I manage to display and/or modify existing wordpress's meta. For example, I want the "nickname" default meta became "Ingame Nickname" and it to be display in the same form that my custom metas (with also firstname and lastname....).

    Do I only have to add their key_value to the short code ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.