Support Forum
Support › MB User Meta › User Meta not saving
Dear Support,
I have a strange problem and that is some user meta is not saving. I disable all the plugin's and tested and still could not save. Created a new user and the user meta could be saved with or without all the plugin's enabled. It seems to be random as tested a few older ones and they are having the problem, but not all of them. I have created a copy of the website which is where i am doing the testing.
Thank you
dave
Hi there,
Can you give me the code you use to register meta box?
Hi Truong,
Here is the code. The strange thing is the code works, but it seems that we have some users entries which will not update. That is the confusing thing.
Thank you
Dave
<?php
add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
function your_prefix_register_meta_boxes( $meta_boxes ) {
$meta_boxes[] = array (
'id' => 'voting-section',
'title' => 'Voting Section',
'pages' => array (
'post',
'page',
),
'context' => 'normal',
'priority' => 'high',
'autosave' => false,
'fields' => array (
array (
'id' => 'select_18_karen',
'name' => 'Karen\'s Vote',
'type' => 'select',
'placeholder' => 'Select an Item',
'options' => array (
'Accept' => 'Accept',
'Reject' => 'Reject',
'Under Review' => 'Under Review',
'Mentorship' => 'Mentorship',
),
'columns' => 3,
'std' => array (
'Under Review',
),
),
array (
'id' => 'select_20_jill',
'name' => 'Jill\'s Vote',
'type' => 'select',
'placeholder' => 'Select an Item',
'options' => array (
'Accept' => 'Accept',
'Reject' => 'Reject',
'Under Review' => 'Under Review',
'Mentorship' => 'Mentorship',
),
'columns' => 3,
'std' => array (
'Under Review',
),
),
array (
'id' => 'select_21_melissa',
'name' => 'Melissa\'s Vote',
'type' => 'select',
'placeholder' => 'Select an Item',
'options' => array (
'Accept' => 'Accept',
'Reject' => 'Reject',
'Under Review' => 'Under Review',
'Mentorship' => 'Mentorship',
),
'columns' => 3,
'std' => array (
'Under Review',
),
),
array (
'id' => 'select_22_susan',
'name' => 'Susan\'s Vote',
'type' => 'select',
'placeholder' => 'Select an Item',
'options' => array (
'Accept' => 'Accept',
'Reject' => 'Reject',
'Under Review' => 'Under Review',
'Mentorship' => 'Mentorship',
),
'columns' => 3,
'std' => array (
'Under Review',
),
),
array (
'id' => 'select_23_terri',
'name' => 'Terri\'s Vote',
'type' => 'select',
'placeholder' => 'Select an Item',
'options' => array (
'Accept' => 'Accept',
'Reject' => 'Reject',
'Under Review' => 'Under Review',
'Mentorship' => 'Mentorship',
),
'columns' => 3,
'std' => array (
'Under Review',
),
),
array (
'id' => 'select_24_pao_copy_17',
'name' => 'Pao\'s Vote',
'type' => 'select',
'placeholder' => 'Select an Item',
'options' => array (
'Accept' => 'Accept',
'Reject' => 'Reject',
'Under Review' => 'Under Review',
'Mentorship' => 'Mentorship',
),
'columns' => 3,
'std' => array (
'Under Review',
),
),
array (
'id' => 'select_25_kaye',
'name' => 'Kaye\'s Vote',
'type' => 'select',
'placeholder' => 'Select an Item',
'options' => array (
'Accept' => 'Accept',
'Reject' => 'Reject',
'Under Review' => 'Under Review',
'Mentorship' => 'Mentorship',
),
'columns' => 3,
'std' => array (
'Under Review',
),
),
array (
'id' => 'textarea_13_notes',
'type' => 'textarea',
'name' => 'First Tier - Voter Notes & Comments',
'columns' => 12,
),
array (
'id' => 'divider_16',
'type' => 'divider',
'name' => 'Divider',
),
array (
'id' => 'select_15_caitlin',
'name' => 'Caitlin\'s Vote',
'type' => 'select',
'placeholder' => 'Select an Item',
'options' => array (
'Accept' => 'Accept',
'Reject' => 'Reject',
'Under Review' => 'Under Review',
'Mentorship' => 'Mentorship',
),
'columns' => 3,
'std' => array (
'Under Review',
),
),
array (
'id' => 'select_16_lisa',
'name' => 'Lisa\'s Vote',
'type' => 'select',
'placeholder' => 'Select an Item',
'options' => array (
'Accept' => 'Accept',
'Reject' => 'Reject',
'Under Review' => 'Under Review',
'Mentorship' => 'Mentorship',
),
'columns' => 3,
'std' => array (
'Under Review',
),
),
array (
'id' => 'select_17_hannah',
'name' => 'Hannah\'s Vote',
'type' => 'select',
'placeholder' => 'Select an Item',
'options' => array (
'Accept' => 'Accept',
'Reject' => 'Reject',
'Under Review' => 'Under Review',
'Mentorship' => 'Mentorship',
),
'columns' => 3,
'std' => array (
'Under Review',
),
),
array (
'id' => 'select_19_diana',
'name' => 'Diana\'s Vote',
'type' => 'select',
'placeholder' => 'Select an Item',
'options' => array (
'Accept' => 'Accept',
'Reject' => 'Reject',
'Under Review' => 'Under Review',
'Mentorship' => 'Mentorship',
),
'columns' => 3,
'std' => array (
'Under Review',
),
),
array (
'id' => 'textarea_notes_2',
'type' => 'textarea',
'name' => 'Second Tier - Voter Notes & Comments',
'columns' => 12,
),
array (
'id' => 'divider_15',
'type' => 'divider',
'name' => 'Divider',
),
array (
'id' => 'checkbox_list_16_mentorship',
'name' => 'Mentorship',
'type' => 'checkbox_list',
'options' => array (
'yes' => 'Yes',
),
'columns' => 3,
),
array (
'id' => 'checkbox_list_17_facebook',
'name' => 'Facebook introduction',
'type' => 'checkbox_list',
'options' => array (
'yes' => 'Yes',
),
'columns' => 3,
),
array (
'id' => 'checkbox_list_16_map_listing_approval',
'name' => 'Map Listing Approval',
'type' => 'checkbox_list',
'options' => array (
'yes' => 'Yes',
),
'columns' => 3,
),
array (
'id' => 'checkbox_28',
'name' => 'Images With Heart',
'type' => 'checkbox',
'desc' => 'Only check if the person has images on Images with Heart website',
'columns' => 3,
),
),
'type' => 'user',
);
return $meta_boxes;
}
The code above works right for me. Can you give me the list of plugins you use? And if you meet an user which can not save, please give me the information of that user like: user role, you are editing user or editing profile, new user or old user.
Thank you.
Hi Truong,
Yep, the code works its just we found a few where the code is not working. I haven't tried to making the changes in the SQL as of yet.
Here is a list of what's install.
-- WordPress Active Plugins
Admin Columns Pro: 4.0.7
Akismet Anti-Spam: 3.3.3 (needs update - 3.3.4)
BackupBuddy: 8.0.1.0
BAW Login/Logout menu: 1.3.3
Blackhole Pro: 1.1
Bloom: 1.2.16
Download Monitor: 1.9.7
Envira Gallery: 1.6.1.3
Envira Gallery - Limit Caption Text: 1.0.0
Give - Donation Plugin: 1.8.11 (needs update - 1.8.12)
Give - Form Field Manager: 1.1.3
Give - MailChimp: 1.3.6
Give - PDF Receipts: 2.0.7
Give - Recurring Donations: 1.3.1
Give - Stripe Gateway: 1.5
Gravity Forms: 2.2.3
Gravity Forms Dropbox Add-On: 2.0
Gravity Forms MailChimp Add-On: 4.2
Gravity Forms Signature Add-on by ApproveMe: 1.5.0
Gravity Forms User Registration Add-On: 3.7
GravityView: 1.21.5.3
GravityView - A-Z Filters Extension: 1.0.7
GravityView - Advanced Filter Extension: 1.0.20
GravityView - Gravity Forms Import Entries: 1.3.2
GravityView - Maps: 1.4.2
Imagify: 1.6.8
iThemes Security Pro: 4.2.0
iThemes Sync: 2.0.1
MB User Meta: 1.2
Menu Items Visibility Control: 0.3.5
Meta Box: 4.12.2
Meta Box Builder: 2.2.1
Meta Box Columns: 1.0.2
Meta Box Updater: 1.1.4
Monarch Plugin: 1.3.18
MonsterInsights - Dimensions Addon: 1.0.7
MonsterInsights - eCommerce Addon: 7.0.2
MonsterInsights - Forms Tracking Addon: 1.0.0
MonsterInsights - Google Optimize Addon: 1.0.0
MonsterInsights - Performance Addon: 1.2.0
MonsterInsights Pro: 6.2.0
My Custom Functions: 4.4.1
New User Approve: 1.7.4
New User Approve Options: 0.2.2
OptinMonster API: 1.2.1
Postman SMTP: 1.7.2
RCP - Download Monitor Bridge: 1.0.3
Restrict Content Pro: 2.8.6
Restrict Content Pro - CSV User Import: 1.1.5
Restrict Content Pro - Custom Redirects: 1.0.2
Restrict Content Pro - MailChimp: 1.3
Soliloquy: 2.5.3.1
Soliloquy - Carousel Addon: 2.2.1
Soliloquy - CSS Addon: 2.2.1
Starbox PRO: 1.3.1
Surbma - Divi & Gravity Forms: 1.5.7
User Role Editor: 4.35.3
User Switching: 1.0.9
WooCommerce: 3.1.1
WooCommerce Stripe Gateway: 3.2.2
WooCommerce UPS Shipping: 3.2.3
WooCommerce USPS Shipping: 4.4.7
WP E-Signature: 1.5.0.3
WP E-Signature Business add-ons: 1.5.0.1
Yoast SEO: 5.1
-- WordPress Inactive Plugins
Remove Dashboard Access: 1.1.3
Username Changer: 3.1.0
WooCommerce Helper: 1.7.2
WP-SpamShield: 1.9.17
WP All Import - User Import Add-On: 1.0.9
WP All Import - WooCommerce Add-On Pro: 2.3.4
WP All Import Pro: 4.4.3
WP Rocket: 2.10.6
-- Webserver Configuration
PHP Version: 5.6.30
MySQL Version: 5.6.31
Webserver Info: Apache/2.4.26
-- PHP Configuration
Safe Mode: Disabled
Memory Limit: 384M
Upload Max Size: 48M
Post Max Size: 48M
Upload Max Filesize: 48M
Time Limit: 90
Max Input Vars: 600
Display Errors: On (1)
Hi Truong,
If you like i would be happy to give you access to the test server. As this problem is just not making sense, three people just signed up and 2 are having this problem, while the first is working fine.
Dave
Hi Truong,
I turned on the debug and i see this
[07-Aug-2017 15:50:28 UTC] PHP Notice: Undefined index: post_type in /usr/home/tsttechnology/public_html/tstdemo.com/wp-content/plugins/meta-box-builder/inc/class-meta-box-import.php on line 115
And there is something else strange, I change the problem line and its changing another one. Instead of changing the one it should be changing.
Hi there,
Do you mean when you save user A, it saves data to user B?
I will check from Meta Box builder first. Thank you for the useful information.
Update: I think the problem with Meta Box builder is not related to problem with user meta problem. Can you give us your admin credential to [email protected]?
Hi Truong,
Yes, if you update A it will change B, and not update A.
Ok will create an account on the test server.
Dave.
Hi Truong,
Some of the users having problems are as follows Ewan, Rosa, Kathy Kinnear and Shannon McLaughlin Kirkman
Thank you
Dave
I think it is the same problem that I have with meta_term which comes from the post revision check in the save_post method of the RW_Meta_Box class.
I did override the complete save_post method into the MB_Term_Meta_Box class which extends RW_Meta_Box and make sure to remove (or comment as you wish) those lines:
// Make sure meta is added to the post, not a revision.
$the_post = wp_is_post_revision( $post_id );
if ( $the_post ) {
$post_id = $the_post;
}
Truly yours,
Eric
Hi,
I received your credential. Now I will check it.
Update: I can't login with your credential. Can you check again and send the new credential?