Hi @tuhin
Thanks for your concern. All servers have a limit of how many PHP variables can be used at one time, and how big an array variable can be.
Your repeater field is perhaps the larges I have ever seen, and this field was not intended to be used in this manor.
ACF does not contain a limit, but PHP does. It is possible to increase this max_vars
limit and PHP memory
like so:
http://www.advancedcustomfields.com/resources/faq/losing-data-save/
Thanks
E
Hi @bgs
I can’t successfully replicate this issue on my end. Are you able to setup a clean install on a local site to test the issue with only ACF + flex field activated?
It is possible that the issue here is a server PHP memory limitation which is terminating the save function early. A local testing environment will not be effected by this and could help to determine the cause of the issue.
Thanks
E
Hi @noisemedia
Thanks for the question.
You will find the same issue in this thread:
http://support.advancedcustomfields.com/forums/topic/option-fields-not-saving-within-flexible-content/
In short:
The wp_options table has a character limit of 64 on the options_name column. This means that WP can’t save any data that exceeds this limit. Your nested repeater field is most likely causing the field_name to become too long.
Please read the linked thread for some solutions.
Thanks
E
Hi @startupguys
I have a feeling that this issue is related to a character length of the value you are trying to save.
The wp_options table has a character limit of 64 on the options_name column. This means that WP can’t save any data that exceeds this limit. Your nested repeater field is most likely causing the field_name to become too long.
For extra reading, you can read about how the repeater field saves it’s data here:
http://www.advancedcustomfields.com/resources/field-types/repeater/
Your options are to either:
1. Increase the ‘Length’ for the option_name column
2. Change your field names to be shorter
Thanks
E
Hi @LDQ
This issue can occur when a previous value for ‘field_name’ existed with a value of 121. Perhaps this field used to be an image, file, or post object field?
I would set a max rows to 1. This will prevent the interface from rendering all the rows. Then save the repeater field with only 1 row. Now go back and remove the max rows limit from the field, and you should be good to go!
Thanks
E
I’ve upgraded the memory_limit to 256M both in php.ini and config.php. i have no errors logged.
######## UPDATE ##########
I decided to run a test.
1. I got a new WP installation up.
2. Used WP default theme
3. Installed ACF only (no add-ons)
4. Added new field group
5. Started adding field by field. Field1 / Update – Field2 / Update and so on…
After I reached Field57 no more fields can be saved. Not only the fields, but any settings below that last field. “Locations” (if statements) and “Options” (hide/show metabox) won’t save.
If I remove one field. I am able to save the options and I am able to add another field.
I have a VPS. So I set it up to have 256M of memory_limit. I also set WP to have the following:
define(‘WP_MEMORY_LIMIT’, ‘256M’);
define(‘WP_MAX_MEMORY_LIMIT’, ‘256M’);
I read in the codex that WP_MEMORY_LIMIT only works on the front-end and that WP_MAX_MEMORY_LIMIT is for the backend.
I also checked error logs in the public_html folder and in the theme folder. There are no errors.
ACF is the only plugin installed.
There are no pages/posts or extra amount of content that could slow down the page on save.
The ACF field page itself, throws no errors. It does not take long to load once you click on “Update”.
While trying to trouble shoot the issue. I also noticed that there’s a glitch with the “update” button and WP 3.8. The button is initially red (theme color), but once the page has loaded the button goes back to “blue” which was the original color before WP 3.8.
I am on iOS Mavericks 10.9.1
I tried adding more fields using the latest versions of Safari, Firefox and Chrome. My primary browser is Chrome.
##########UPDATE############
I downgraded the plugin to version 4.1.0
I was able to add 17 more fields. So I am now on Field74. After adding field 74, I run in to the same issue again.
I am still running more test.
Hi @James
ACF doesn’t use the standard WP form, so the ‘postmeta_form_limit’ shouldn’t be an issue (unless i’m missing something).
Your best bet is to check your server logs for any hints as to server failure during the save.
Like I said, The max_vars is a good place to start, but it is important to make sure that this value is being used by your server. Please google how to test server info such as max_vars.
Good luck
Thanks
E
Hi @James
There is no limit for saving fields in a field group.
Each time you save, all fields are updated and this requires PHP memory, vars, database calls and time.
It is possible that your server is not allowing the sufficient resources needed for the save to complete. The max_vars is a good place to start, but it is important to make sure that this value is being used by your server. Please google how to test server info such as max_vars.
Here are some similar threads:
http://support.advancedcustomfields.com/forums/topic/field-group-not-accepting-more-than-69-fields/
http://support.advancedcustomfields.com/forums/topic/is-there-a-limit-on-fields/
Hope that helps.
Thanks
E
Hi @elliot,
When layouts get lost after saving they are not available for selection on a post edit page any more. But as long as I don’t save the post the lost layouts will be displayed correctly on the front end.
When I delete a layout (which contains 20 subfields) from the flexible content field, saving of the whole field group succeeds. Also adding a new layout afterwards, saves succesfully. But adding many subfields to that new layout resulted in a failure again. Deleting additionally another layout with nearly 20 subfields allowed me to save the new layout successfully.
Creating and displaying a new field group containing a flexible content field is no problem.
Also execution time is no problem. Other processes which need about one minute have finished successfully.
Is it possible, that WP limits the number of max_input_vars?
Hi @tanghe
Any premium ACF add-on can NOT be included in a free theme. You can learn more about this here:
http://www.advancedcustomfields.com/resources/getting-started/including-acf-in-a-plugin-theme/
It is possible to add a ‘column’ sub field to each flexible content layout so that you can add in each column and specify the width as you go.
There is no limit in ACF, but all servers have a limit of how much data they can save in one go. Please search this forum / google for max_vars and you will find some interesting threads.
Thanks
E
Hi @Full Circle Design
This is definitely an issue caused by your server hitting either a memory or max_vars limit.
Please read over these threads and let me know how you go with the updated PHP settings:
http://support.advancedcustomfields.com/forums/topic/cant-add-more-to-repeater-item/
http://support.advancedcustomfields.com/forums/topic/update-acf-changes-add-new-sub-field/
http://support.advancedcustomfields.com/forums/topic/group-limited-to-75-entries/
Thanks
E
Hi @mcdg
Your issue is most likely related ot your server running our of memory or vars during the save:
Please read over these related threads:
http://support.advancedcustomfields.com/forums/topic/cant-add-more-to-repeater-item/
http://support.advancedcustomfields.com/forums/topic/group-limited-to-75-entries/
http://stackoverflow.com/questions/19089270/max-input-vars-and-acf
Thanks
E
Ok, I resolved this. Couple of things to try – Ensure that the order of conditionals is correct, I had mine a bit messed, was adding an item in the middle instead of appending it to the end. I also increased the max_input_vars tp 6000 and threw the max_input_nesting_level to 10000.. I cannot say if they made a difference, I have limited time to test, I’m fairly confident that its the order that caused it to remove conditionals…
Hi Elliot,
There is no error in the source except
<script type='text/javascript'>
/* <![CDATA[ */
var pluploadL10n = {"queue_limit_exceeded":"You have attempted to queue too many files.","file_exceeds_size_limit":"%s exceeds the maximum upload size for this site."........
.
I can confirm that on my local install, I can create a text sub field which contains tall 7 conditional logic rules from the 7 radio button choices…
I would try on a clean install. You may find that the issue was more to do with a server limit on how many variables can be posted at one time.
Hope that helps.
Thanks
E
Hi @M Squared Graphics
Thanks for the info.
I think the issues is that WP cannot save the data of the teams_test (nested repeater) because the field name is too long!
the wp_postmeta table has a character limit on the meta_key value, and to save a value in that nested repeater, the name would have to be:
btg_daily_booth_schedule_test_0_teams_test_0_user_test
Perhaps you will need to rename your fields to make it shorter?
You will loose any current data in doing this however… It’s worth a test with a new repeater field though.
Thanks
E
Hi Elliot,
I tested it with a single select and multi-select. Neither is saving regardless if it’s one user name or 10. Either way it’s not enough that should cause a server limit.
However, If I take the user field out of the nested repeater and move it up one level it saves the data.
If I do this to get around the problem and achieve what I need to do. Then I have to use the multi-select for the user list. But I have been completely unsuccessful in getting that list of users to show on the screen. I’m trying to get first name, last name and email.
Is there something different about retrieving user from a multi-select? I’ve got the single user select working on other pages as in the links mentioned above. I don’t see much about the user field in the documentation.
Thanks a bunch for the help.
Regards,
Sandra
Hi @M Squared Graphics
Perhaps your server is hitting a limit during the save poccess and terminating early?
How much data are you trying to save at one time.
With the repeater field save correctly if there is only 1 row of data?
Hi Elliot
Thanks for taking the time to look at my request. Really appreciate it.
Apologies for incorrectly filing this under ‘bugs’ when it’s my limited skills that are the problem 🙂
Can you please be more specific. I’ve tried to follow the tutorials and as much as I can and find as much in the forums as possible but I’m still not seeing it.
Sorry man.
Hi @vakondweb
Please search before posting a new topic.
http://support.advancedcustomfields.com/forums/search/?bbp_search=save+limit
Thanks
E
Hi @freakymiky
If you check the code you will find that ACF does NOT have any limitation on the number of sub fields.
The only limitation is server based. All servers have different limits on the number of variables that are able to be posted / saved / used. Perhaps you were hitting a server PHP or max_vars limit?
Thanks
E
Hi @freakymiky
Just to clarify, the issue is that you can’t svae any more than 16 sub fields when editing an ACF field group.
This is most likely due to a server limitation. You can only posts so many variables in one go, and this is why you are not able to save all the data on the page.
What you will need to do is split the fields into 2 field groups. This way you can save half the data
Thanks
E
Hi @Svenni
It sounds like you are sitting on the cusp of your PHP limit. This would explain why sometimes the sub fields are loaded, and other times it is not.
Hitting your PHP limit will cause the current function to just stop, so when ACF is loading in the fields, it is most likely running out of memory and just stopping.
Have you contacted your host to look at error logs?
The die
I mentioned was in regards to debugging the save_post function in the core/controllers/field-group.php file.
My advise was to edit the loop which saves the fields, and simple echo the field name, then die at the end of the loop. This will visually show you how far the loop got through.
Does that help?
Thanks @jplew that did the trick! However I wasn’t getting any PHP Warnings in my error log – in fact I’m getting no errors when I save the form which is strange.
Initially I thought my solution of deleting and re-adding entries worked but I hit the same brick wall a few days later. I had come across max_input_vars previously but it was commented out in my PHP.INI so naively assumed it was Unlimited. Here’s what I’ve added in my .htaccess to fix the issue:
php_value max_input_vars 3000
php_value max_input_time 120
php_value max_execution_time 60
I’ll have to keep an eye on it but hopefully 3000 is high enough to avoid this problem occurring in the future.
Thanks for all the help guys
Chris.
Hi @ofir
Thanks for the info. I haven’t come across an issue like this before and as a fundamental of the web world, data can’t magically disappear.
It is most likely that the article has been edited and saved adn maybe an error on the page prevented the correct data from being posted?
Maybe even the server hit a memory limit during the save? But it doesn’t sound like that would be the issue here.
Hopefully this doesn’t come up again, but ACF only touches the database on the save_post action, no other time.
Sorry I can’ tbe of much other help here.
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.