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().

  • Nobody??!

    • James

    • December 31, 2018 at 7:08 am

    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.

    • bandv

    • January 2, 2019 at 11:29 pm

    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.

    • Novalis

    • January 9, 2019 at 12:56 am

    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.

    • Novalis

    • January 9, 2019 at 1:08 am

    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”

    • Novalis

    • January 9, 2019 at 1:38 am

    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.

    • edede

    • January 9, 2019 at 7:13 am

    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.

    • atrecha

    • January 10, 2019 at 5:52 am

    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.

    • atrecha

    • January 11, 2019 at 4:49 am

    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.

    • edede

    • January 12, 2019 at 7:17 am

    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.

    • edede

    • January 12, 2019 at 7:52 am

    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 🙁

    • edede

    • January 12, 2019 at 11:26 am

    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.

Viewing 23 posts - 1 through 23 (of 23 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.