I am using ACF PRO for a client site. One of the many custom fields I set up no longer takes input. When the client presses update it spins and then we get the white screen. This particular repeater field has many entries. Is there a limit to the number of entries you can do?
I though maybe the plugin needed updating but when I try, it says I don not have sufficient permissions to view this page.
Any ideas on how to fix this would be greatly appreciated.
Thanks for the question.
There is no limit to the number of custom fields that can be added to a field group or in your case the repeater. Your server might be terminating the save process before ACF completes its job, you will need to increase the max_vars PHP setting. You can make the following changes to your php.ini file:
max_input_vars = 3000 suhosin.get.max_vars = 3000 suhosin.post.max_vars = 3000 suhosin.request.max_vars = 3000
The WSOD might also be as a result of a plugin conflict, please deactivate all other installed plugins and switch to one of the stock WP themes to check if the issue will still pop up.
To update the plugin you will need to log in as an admin.
I’ve recently had the same issue with a client site. On one field group there is a repeater that has a huge number of fields to meet their requirements. At a certain point the page just times out. This is not a limitation with ACF per se, it is really a limitation in WP due to the way it updates custom fields.
Each field in ACF causes an
update_post_meta() function call and each of these function calls creates a new database request. At some point the number of database requests just becomes too much and the page load times out.
There is a work-a-round. If you set the time limit on scripts significantly high enough
set_time_limit(0); the server will continue to process the data after the page load has timed out. The reason it does this is that PHP does not test to see if the user has disconnected until it tries to send data and since PHP does not try to send data until after all the database processing is done it blissfully continues processing.
These are the steps to take when this is happening
1) Initially publish or save the post with minimal data
2) When a timeout occurs, click the browser back button
3) DO NOT click the publish/update button
4) Reload the page until all of the changes appear
Thanks for the input guys!
It definitely seems to be a timeout sort of issue… the WSOD is now showing up before I even try and update a field. I turned on debug and it says “Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 72 bytes) in …filepath/meta.php on line 829”.
I’m not familiar with editing the php.ini file. I searched and mine is in my MAMP files and assume that editing this would have no effect on the client. Would the file I need to edit be on their server?
As far as updating the plugin goes, I am indeed logged in as an admin but it still won’t let me… weird.
Where would I set set_time_limit(0);? Is that in the php.ini file as well?
Thanks for helping out the php newbie!
You can set the time limit is several places, php.ini, in the .htaccess file if the host allows it or in a php file. I’m afraid that the worse issue is the memory limit error. 268435456 = 256MB. You can increase the allowed memory in the same places, you can try increasing it but some hosting providers have a max on this and it is also limited by the physical memory of the server.
You must be logged in to reply to this topic.
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!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.