Home › Forums › Bug Reports › cannot update posts with acf fields
Hi guys!
This is driving me MAD. Im not sure if it’s because of the new wordpress or the new ACF update but now I get a white screen with No data received ERR_EMPTY_RESPONSE after updating or publishing a new page with ACF fields assigned to it (normal ones work fine) this is happening online as well as in my local test environment. I’ve set WP_DEBUG, true but nothing is given me to debug. Im using a completely custom build theme that worked great before, it’s a shame how this can happen if you ask me. How can this be avoided?
this is the website: http://www.remonskappersenbarbier.nl/ but that probably does not help out that much. Thanks!
How can we solve this ASAP?
Also add define('WP_DEBUG_DISPLAY', true);
to show errors and see if that helps figure out where the problem might be.
Thanks for jumping in John, unfortunately, nothing helps.
I have this on multiple local and server installations right now! what on earth can cause this?
I get these errors when updating a page with debug on:
Notice: De aangeroepen constructor methode voor WP_Widget is verouderd sinds versie 4.3.0! Gebruik
__construct()
in plaats daarvan. in /Users/boriskamp/Documents/Local Websites/remons_barbershop/wp-includes/functions.php on line 3457
Warning: Cannot modify header information - headers already sent by (output started at /Users/boriskamp/Documents/Local Websites/remons_barbershop/wp-includes/functions.php:3457) in /Users/boriskamp/Documents/Local Websites/remons_barbershop/wp-admin/post.php on line 242
Warning: Cannot modify header information - headers already sent by (output started at /Users/boriskamp/Documents/Local Websites/remons_barbershop/wp-includes/functions.php:3457) in /Users/boriskamp/Documents/Local Websites/remons_barbershop/wp-includes/pluggable.php on line 1207
any clues? it’s all in the WordPress files, I don’t understand this at all, how can this happen?
I tried manually overwriting the server files with clean new ones as well and nothing helps.
I need this fixed, this is unacceptable to my clients, just because of an update.
What can I do figure this out some more?
After translation:
Notice: The invoked constructor method WP_Widget
is obsolete since version 4.3.0! use
__construct ()
The next thing I would start doing is disabling all plugins, especially plugins that have anything to do with widgets. I’ve done a quick check of WP code and ACF does not call this class as far as I can find.
Hi John,
Ive done a completely new local install of WordPress, I only installed ACF Pro and copied the theme from my original site to this new one and activated it.
so in other words, everything is brand new, except for the theme.
Now when I try to update a page, I still have the same white screen of death, this time without ANY error notice….
some more info:
– When I enable twentyfifteen theme and ACF Pro, and and create a field group to appear on all pages, and create a new page with custom fields in it, it works!
here’s an important one:
– With my custom theme and ACF Pro enabled, no field groups assigned to pages (just basic title and WYSIWYG editor), creating and updating pages works…..
Again, I have this on multiple sites now, so it’s not just a one website situation.
Any further clues?
If you’re getting a white screen then there must be an error. It could be a parse error in a file, which I’m not sure if WP DEBUG can report on or not.
My next suggestion would be to turn on standard php error reporting rather than using WP DEBUG. Either by changing php.ini, or in your .htaccess file if you can do that.
I would usually add the following to my .htaccess file, but this may not work for you.
php_value display_errors On
php_value error_reporting 6143
If you can’t do either of the above then you need to open the first file loaded and add the following line to the top of the file. For updating or editing a post is would be /wp-admin/post.php
ini_set('display_errors', 1);
Thanks for the reply John,
I Put the ini_set('display_errors', 1);
line right below my opening <?php
tag in post.php
. Still nothing visible error-wise while updating pages?
Do you need a copy of my database and files in order to check this out yourself? If you give me an email via private message I will send you the db dump and copy of the complete WordPress folder.
Thanks!
I’m not associated with support, I just help out here on these forums. This is basically a community forum.
You might want to put in a support ticket http://support.advancedcustomfields.com/new-ticket/
If you’re getting an error that causes a white screen and you don’t know what the error is, I’m really out of ideas on how I can help
I understand, I did sent a support ticket but have not yet received a reply.
Thanks for trying to help me out! Im heavily hoping the someone from the team will help me out with this!
You said that it’s a local server. I would try changing php.ini to turn on error reporting. Basically, you need to figure out what is causing the fatal php error before you’re going to get any further. You might try downloading and reinstalling everything, but I can’t say it that’ll help of not.
Hi John,
Thanks for that! I have no experience with that, can you elaborate a bit more on changing php.ini to do this? I already did a reinstall, did not work
Well, I don’t know where your php.ini file is, usually in one of the folders in the server path, sometimes you can have a php.ini file per site.
Then search the ini file for display_errors
if the value of it is 0, change it to 1, if the value is Off, change it to On.
I found it in MAMP, I have the following line:
display_errors = MAMP_display_errors_MAMP
found out that it’s logged to a file as well, but I see no new entry to that file when my page updating fails.
Why is Elliot or somebody else from ACF not jumping in this one? It’s a critical issue!
As I said, this is a user help forum where users help users. There are some of us that help out a little more than others, but as a general rule Elliot and the regular support staff do not read and respond here. That is what support tickets is for.
This is also a forum for help with things that are generally specific to ACF. As I’ve said in previous replies, I have a testing site that has the most recent version of WP and the most up to date version of ACF installed. I have one for ACF5 and one for ACF4. Without any plugins other than ACF installed and using the default WP theme I cannot recreate the errors that you’re seeing. This means that the error is not related to ACF but that there is some other bug or problem.
At this point you need to be able to do some basic debugging to find the cause of the fatal error that’s causing PHP to show only a white sceen. The best way to do this is to turn on display of PHP errors on your server.
I really have no idea what display_errors = MAMP_display_errors_MAMP
does. I would alter php.ini to show errors on the screen and I would alter the errors that are displayed to E_ALL
. For more information on this you can see this page on PHP configuration http://php.net/manual/en/errorfunc.configuration.php
John! I found the issue after I did somme commenting out in my functions.php
I had this function in there for a long time by now, seems that at this moment, it breaks the update process of anything related to post.php
. Here’s the function:
//Auto add and update Title field:
function my_post_title_updater( $post_id ) {
$my_post = array();
$my_post['ID'] = $post_id;
$my_post['post_title'] = get_field('kop');
// Update the post into the database
wp_update_post( $my_post );
}
// run after ACF saves the $_POST['fields'] data
add_action('acf/save_post', 'my_post_title_updater', 20);
I use this function to update my post’s/page’s title field with an ACF field value, do you have any clue on why it breaks now?
Thanks!
I think the code is causing and infinite loop. There have actually been a few threads about this.
Check out the second comment here http://support.advancedcustomfields.com/forums/topic/update-value-function-causes-timeout/
Ahh yes!
Thanks John!
Changed my code to this:
//Auto add and update Title field:
function my_post_title_updater( $post_id ) {
$my_post = array();
$my_post['ID'] = $post_id;
$my_post['post_title'] = get_field('kop');
//Unhook function to prevent infitnite looping
remove_filter('acf/save_post', 'my_post_title_updater', 20);
// Update the post into the database
wp_update_post( $my_post );
//Rehook function to prevent infitnite looping
add_filter('acf/save_post', 'my_post_title_updater', 20, 3);
}
// run after ACF saves the $_POST['fields'] data
add_action('acf/save_post', 'my_post_title_updater', 20);
and now it finally works again!
Thank you very much for guiding me to the solution John!
The topic ‘cannot update posts with acf fields’ 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.