Home › Forums › Add-ons › Repeater Field › Repeater meta_value count in wp_postmeta not increasing
Hello All,
This problem is related to the admin side of WP.
I’m having a problem adding an image to my repeater. The changes/edits are not being applied/updated/saved.
On inspection of the table I noticed that the id’s for the images are being saved in the table but that the overall count for the meta_value is not increasing.
E.G. 3 images but the count is still at 2.
Also noticed that the field id is different from previous int() only fields
E.G field_14, field_15 to now field_521545badeb7d
Any ideas?
I’ve also attached sql dump
(8855, 454, "alternativeimages_0_altimage", "667"),
(8856, 454, "_alternativeimages_0_altimage", "field_521545badeb7d"),
(8857, 454, "alternativeimages", "1"),
(8858, 454, "_alternativeimages", "field_52154598deb7c"),
(8859, 454, "alternativeimages_1_altimage", "670"),
(8860, 454, "_alternativeimages_1_altimage", "field_521545badeb7d");
Hi Elliot,
Firstly thanks for replying.
Secondly… your plugin is great… Keep up the great work and I’ll keep paying for premium plugins.
I’ve changed the fields and we still have the same problem.
(8878, 454, 'alternative_images_2132155_0_alt_image_2135469456', '668'),
(8879, 454, '_alternative_images_2132155_0_alt_image_2135469456', 'field_5216e415fb920'),
(8880, 454, 'alternative_images_2132155', '1'),
(8881, 454, '_alternative_images_2132155', 'field_5216e3e8fb91f'),
(8882, 454, 'alternative_images_2132155_1_alt_image_2135469456', '667'),
(8883, 454, '_alternative_images_2132155_1_alt_image_2135469456', 'field_5216e415fb920');
Hi @hillbilly
Perhaps the issue is that your server is unable to save any more data in the request.
Can you check your console logs to see if the saving process hit any PHP memory / max vars limit?
Thanks
E
I’m running this
php_value max_input_nesting_level 128
php_value max_input_time 300
php_value max_input_vars 3000
php_value max_execution_time 300
php_value post_max_size 32M
php_value memory_limit 128M
In the htaccess file. i’ve also checked phpinfo and the settings are correct.
There is no errors in the logs regarding memory limits.
The standard fields of the page are saving changes e.g. Title/Content etc.
It is just the ACF fields that do not change.
Were do you want me to debug the issue?
_functions.php -> update_field or update_value ???
Hi @hillbilly
I would start digging around in the repeater.php file (Add-on)
Look at the update_value function and log some values during the save loop.
Good luck!
Thanks
E
Ok.
I worked this one out.
The problem is caused by a conflict in priorities of the do_action.
Both ACF and WPSC have a ‘save_post’ with a priority of 10.
This is the referring article
http://support.advancedcustomfields.com/forums/topic/text-area-fields-are-not-saving-on-update/
To fix this without hacking the WPSC file (Which gets overwritten on an update) then add this to your functions.php file.
if( has_action( 'save_post', 'wpsc_admin_submit_product' ) )
{
remove_action( 'save_post', 'wpsc_admin_submit_product' );
add_action( 'save_post', 'wpsc_admin_submit_product', 1, 2 );
}
This will replace the ‘save_post’, ‘wpsc_admin_submit_product’ do_action with one that has a lower priority.
This works for me and hopefully you.
Hi @hillbilly
Thankyou for the research, I do appreciate it.
I would rather not bend ACF to work with other plugins code, but have the other plugins be compatible with all others (including ACF)
Is the WPSC plugin terminating the save_post action? Reading the statement you pasted above, it seems like they have not through that other plugins need the save_post action to function.
I’m sure they could change their code to not terminate the core WP action.
Hopefully this is a possibility
Thanks
E
Hi @hillbilly
Good question – this is why ACF is wrapped in a class and all actions / filters are referenced as an array with $this and the function name.
This is a safe guard that assures no conflicts happen between acf and any other plugin.
I suspect the real issue is the WPSC plugin has written their save_function like so:
if( ! is_WPSC_save )
{
return false;
}
This will most likely prevent any further save_post actions from working!
Thanks for your investigation, but I think the author of WPSC should also have a look at this issue to see if they can solve it from their end.
Cheers
E
The topic ‘Repeater meta_value count in wp_postmeta not increasing’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.