Support

Account

Home Forums Gutenberg Custom fields not saving

Solving

Custom fields not saving

  • Hi, using WP 5.0, ACF 5.7.9.

    When Gutemberg editor, changes into custom fields do not update on post/page save.
    If i swith to Classic Editor (Plugin) it works ok.

    My acf fields are generated via php using acf_add_local_field_group().

  • Hi @rgdesign

    Apologies for the delay.

    Are you still having issues with the plugin?

    Kindly share some more details of your setup so that I may be able to advise further.

    Hope to hear from you soon.

  • Hi

    I am attempting a very similar thing to you but having the same problem. When I add a block, type some content into the editor, then deselect the block, and reselect it, the values I entered are missing.

    I have stripped it all back to a really simple test in my functions.php file as follows:

    acf_register_block(array(
    	'name'			=> 'my_test',
    	'title'			=> __('Test'),
    	'description'		=> __('A Test'),
    	'render_callback'	=> 'render_test',
    
    ));
    
    function render_test() {
    	$title = get_field('title');
    	$content = get_field('content');
    
    	?>
    
    		<h2><?php echo $title ?></h2>
    		<?php echo $content ?>
    
    	<?php
    }

    My template is simply:

    <?php get_header(); ?>
    
    <?php the_content() ?>
    
    <?php get_footer(); ?>

    I am using 5.8-beta3. I am at a bit of a loss as to what is going on. If anyone could give me any suggestions, I would really appreciate it!!

    Many thanks
    David

  • Hi, nop, i couldn´t solve the problem using WP 5.0. The only way is to install the Classic Editor plugin, so guttemberg editor will be disabled.

    When guttemberg is enabled, pages, posts, etc, having custom groups/fields, do not save the changes when pressing “publish”. The new content on those fields do not disappear, but if i leave editor and return, no changes saved.

    I guess is something when guttember saves data (js), well, it´s not saving for some reason, thats´s the problem.

  • i can confirm the issue. i use wp 5.0.2
    yesterday i updated to acf 5.7.9
    my custom fields value (for pages) can not be saved anymore.

    1. i can select the new value from acf field.
    2. my editor page updates accordingly. (js hook works)
    3. i publish the changes.
    4. the field is not updated. it does not reflect in frontend. if i reload backend page, the value in acf field is set back to the old one.

    i do have a custom js hack implemented where i switch some images according to the acf field. this hack still works. so for me its clear that acf has a bug here.
    a MAJOR one.

  • Some more insight.

    This is also the case for acf fields in posts.

    Also the issue that you claim as “fixed” (display fields in high position) is actually not fixed. i can still not see a box if i set position to “after title, before content”

  • also the action “acf/save_post” is never triggered

  • Hi Novalis, what you described is exactly my case, same thing. And i´m sure is something related with the acf/save_post… it´s not doing the action when publish posts with gutemberg editor.
    As i said, using old Classic editor, works, but for this on WP 5 and up, you need to disable gutemberg.
    I´m a little worry about this because i have lot of sites runing wp 4.xxx and i can´t update them.

  • Same issue. Troubleshooting included barebones theme running only ACF. Running ACF 5.7.9 + WP 5.0.2.

    I’ve only tried this in Pages vs. Posts. Other items on Pages save fine, issue appears to be ACF-specific.

  • Experiencing this issue as well.
    Wordpress 5.0.2
    ACF 5.7.9

    Page with custom fields – when fields updated they do not save or display with updated data on front end.

    Only when disabling Gutenberg and using classic editor are updates saved/changed.

    Tried using Disable Gutenberg plugin targeting only pages with ACF and this did not work. It appears Gutenberg need to be completely disabled.

    Any word on the 5.8.0 release that is supposedly going to fix issues like this?

  • Hey guys, some more data:

    Yesterday i installed a new site i´ve started to develope, same WP 5.0.2, same ACF 5.7.9, same Parent theme i use for all my projects…. and, when i went to some page (first edited one on fresh install) my custom fields where saved, and in fact is working.

    It´s very strange, on the old websites, where i updated WP from 4.9 to 5.0, this thing about gutemberg and saving fields don´t work. But with same versions installs from zero yes they work. JS Cache problems are not the issue for sure.

    I was clear? new installs works, updated ones not.

    At least that´s my last experience related to this. Hope helps to find what is going on.

  • Well, forget about when i said “working ok”…

    The first field that was saved is a textfield into a group displayed on pages. This one SAVE on page update using gutemberg.

    The second field is a textarea inside a flexible field inside a group. This one NOT SAVE on page update.

    If i use another flexible field, with a select, it was SAVED on update page.

    Those same flexible fields are used also on a custom post type that do not use gutemberg, on those, fields save normaly. Something when using gutemberg for sure, right?

    So… i don´t know, for now i can see something with textareas/text fields on flexible fields not saving with gutemberg.
    Anybody can check something like this situation? Test with diferent field types.

  • Something else, even those select fields SAVE on post update, when i leave the page it alert me if i´m sure since there are changes not saved. When i return to the same edit page, changes into the select are ok.
    Same thing happens if just click Update without changing anything, alert of loosing changes if leave.
    On posts without ACF fields, but using gutemberg (default post), this thing do not happend.

  • UPDATE: I’ve installed the beta3 version and it fixes the issues I had with no unexpected side effects I’ve seen so far.

    Any idea on the final release candidate?

  • I am seeing similar on WP 4.9.9 with the Gutenberg plugin and ACF Pro 5.7.9.

    I save, refresh and none of my custom fields data is stored. It’s also not saved to the DB.

    It’s quite a specialised site – it’s a WP multisite set up with custom post types and quite a few custom fields.

  • Guys, more updates:

    – I´ve installed wp 5.0.3 and acf 5.7.9 on a fresh install and i notice another issue using just Twenty Nineteen theme, where i added just a custom template (clone page.php) to check the Group Location when some page_template.

    I´m having this js error:

    Uncaught TypeError: Cannot read property ‘filter’ of undefined on wp-includes/js/dist/vendor/react-dom.min.js?ver=16.6.3

    This is when editing a page using a group with just one text field inside. The error cames when switch Page Template, since this group has a Location to be visible only on post_type==page and page_template=my-template.php
    The same location also has another rule to be post_type=post && post_category=categoria-test

    As follows:

    if( function_exists('acf_add_local_field_group') ):
    
    acf_add_local_field_group(array(
    	'key' => 'group_5c38d943224d3',
    	'title' => 'Tests on aside posts',
    	'fields' => array(
    		array(
    			'key' => 'field_5c38d946c6704',
    			'label' => 'text',
    			'name' => 'text',
    			'type' => 'text',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array(
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'prepend' => '',
    			'append' => '',
    			'maxlength' => '',
    		),
    	),
    	'location' => array(
    		array(
    			array(
    				'param' => 'post_type',
    				'operator' => '==',
    				'value' => 'post',
    			),
    			array(
    				'param' => 'post_category',
    				'operator' => '==',
    				'value' => 'category:categoria-test',
    			),
    		),
    		array(
    			array(
    				'param' => 'post_type',
    				'operator' => '==',
    				'value' => 'page',
    			),
    			array(
    				'param' => 'page_template',
    				'operator' => '==',
    				'value' => '_template-test.php',
    			),
    		),
    	),
    	'menu_order' => 0,
    	'position' => 'normal',
    	'style' => 'default',
    	'label_placement' => 'top',
    	'instruction_placement' => 'label',
    	'hide_on_screen' => '',
    	'active' => 1,
    	'description' => '',
    ));
    
    endif;

    When editing a post_type = post, the error do not happend, only on pages and only when using gutemberg. If i use Classic Editor Plugin to disable gutember, the error do not hapend. But… a big “but”, on another wp site, same versions, the error also hapend when no gutemberg working.
    I´ve also tested same thing with a custom post type, and same thing, something when switch something that has a location rule assigned.

    Well… return to work 🙂

  • Beta3 did not fix things for me. It actually seems worse as now ACF content is disappearing when I go into a Page’s edit screen before I either edit or try to save anything. As a bonus, it will then allow me to save without the error thinking everything is okay, but it is, in fact, not actually saving.

    Any ACF official response on this issue?

  • Hello again, i´ve downgrade my last fresh install as i mentioned later, so i go down to WP 4.9.9 and all commented errors gone.
    So, i think we should wait for acf 3.8.0 to use wp 5.0.x

    I did not have time to test with wp5 and acf5.8beta yet.

  • I should have read the fine print, I just assumed such a high-profile plug would be updated and work; my bad. I’ve lost several hours figuring this out.

    It’s pretty concerning, this. ACF knew Gutenberg was coming and would ideally have had updates queued up when it released. Instead, it’s been a month+ of incompatibility post-Gutenberg release with no updates. Is this, in fact, a really big issue? Will it be updated and work soon? Will ACF remain viable?

    Checking with my host to see about reverting back.

  • Well, i guess i found something:

    – I´ve updated again to WP 5.0.3
    – Installed Classic Editor to disable gutemberg
    – Installed ACF 5.7.6

    Working ok.

    If i leave Gutemberg, i have problems with conditional location rules for groups, not working. Ex. i have a group wich location is for pages and using a particular page_template. When i change the page_template selector, no group become visible as should be. No errors on console.

    If i update ACF to 5.7.7 i have this js error when ichange the page_template as described above: Uncaught TypeError: Cannot read property ‘showEnable’ of undefined

    On: advanced-custom-fields-pro/assets/js/acf-input.min.js?ver=5.7.7

    Something like on inspector:

    at acf-input.min.js?ver=5.7.7:3
    at Array.map (<anonymous>)
    at acf.Model.t (acf-input.min.js?ver=5.7.7:3)

    So, something related to the location group and how acf detect/process that once the selector triggers “change” or similar.

    Also reading comments for the chages into acf 5.7.7 version says:

    “Dev – Major improvements to the acf.models.Postbox model.”

    Maybe this has something to do with this issue, something with acf.models since that appears to be related to the js error when says acf.Model.t on acf-input.min.js

    So in resume, running WP 5.0.3, but without Gutemberg, and with ACF 5.7.6 is the only way i could make things to keep working as before… till now.

  • Ok, i decided to make the downgrade acf to 5.7.6 on my localhost, many sites at once, all with wp 5.0.3, and problems went, no js errors, fields saves again, no problem with location rules.. but, no gutemberg enabled off course 🙁

  • I rolled back to 4.9.8 and 5.7.9 and all appears to be well, can save and fun things like that. I will wait (an unspecified period) to update until ACF gives thumbs up to Gutenberg/5.x.

    I don’t want to get too far behind WP core updates, so hopefully there’s a fix soon.

  • edede, that´s the reason i ended testing to use anyway WP 5.0.3 but with ACF 5.7.6. I prefer to use last wp model and wait for acf 5.8
    The bad is if you use gutemberg, that´s not my case and i disabled it using Classic Editor plugin.

  • I love ACF, it’s my favorite plug-in, and our website relies on it heavily. I don’t like the idea of using a plug-in to allow another plug-in to work. Like many, I try to avoid using plug-ins if I can figure out how to code it. So this fix is not ideal, but if we get too far down the line here with WP versions, I might just take that route.

    It sounds like they’re working things out, though. I’m excited to get everything back up to current versions ASAP.

Viewing 25 posts - 1 through 25 (of 38 total)

The topic ‘Custom fields not saving’ is closed to new replies.