Support

Account

Home Forums Backend Issues (wp-admin) Repeater not saving data with ACF Pro 5.7.9

Solved

Repeater not saving data with ACF Pro 5.7.9

  • Hello!

    I’m using WordPress 4.9.8 with ACF Pro 5.7.9.

    Bug #1

    When I create a new repeater field, and set up the repeater’s subfields, they disappear when I save the ACF page. I then have to set up the new repeater’s subfields again: when I save the ACF page, it’s ok. Having to do it twice is obviously a bug.

    Bug #2

    When I edit my post and fill the new repeater subfields, their content is not saved to the database! Which is a major bug.

    The bug seems to only affect new repeater fields. Indeed, my old repeater fields still work as expected, I can edit them, and the new content is saved to the database.

    Out of curiosity, I had a look at the ACF PHP exports, to compare the code of new repeater fields with the old ones.

    The key in the sub_fields array doesn’t match the field_xxx usual pattern, and I wonder if this could be the cause of the bug.

    Example of “old”, working repeater field:

    'key' => 'temoignages',
    'label' => 'Témoignages',
    'name' => 'testimonies',
    'type' => 'repeater',
    …
    'collapsed' => 'field_5b87f2c4499ad',
    …
    'sub_fields' => array(
    	array(
    		'key' => 'field_5b87f2b7499ac',
    		'label' => 'Citation',

    Example of new, buggy repeater field:

    'key' => 'precisions',
    'label' => 'Précisions',
    'name' => 'more_details',
    'type' => 'repeater',
    …
    'collapsed' => 'field_5c2ddafc9fefb',
    …
    'sub_fields' => array(
    	array(
    		'key' => 'titre-du-bloc',
    		'label' => 'Titre du bloc',

    Note: I disabled all my other plugins in order to be sure no one is interfering with ACF Pro.

    I also tested with ACF Pro 5.8.0-beta3, 5.8.0-beta2 and 5.8.0-beta1, 5.7.8 and 5.7.7, with no better luck! It had been a while since I had to create new repeater fields, I guess that’s why I didn’t notice these bugs before.

    Any help would be greatly appreciated, as I’m working on a site that goes in production soon.

    Do you think I should open a ticket about this?

    Thank you!

  • There is a filter somewhere on your site that is altering the “slug” of the ACF field post. This is where ACF stores the field key. You need to track down this filter. If you’ve already tried deactivating all other plugins then this is probably in your theme.

  • Thank you so much, John! You put me on the right track! I was looking in the wrong direction, and thanks to your message, I could quickly think of a function that edits slugs.

    Everything is now back to normal. Yay!

    Long live ACF and its community ^.^\m/

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

The topic ‘Repeater not saving data with ACF Pro 5.7.9’ is closed to new replies.