Home Forums Backend Issues (wp-admin) Bug: Flexible Content child field is saving inside sibling repeater as blank


Bug: Flexible Content child field is saving inside sibling repeater as blank

  • Having worked on the same site for the last week (WP 6.1.1 & ACF 6.0.6) I have encountered a problem this morning.

    When creating a new top level field inside of an existing Flexible Content block and then saving the page it disappears on reload. This confused me for some time, but then I noticed it was saving the new field inside a sibling repeater field, but without either the field name or label retained. So I was just ending up with lots of blank fields inside a repeater.

    I have tried this on another site running the same version of WP and ACF, but with a different host (as I initially thought it might be a memory issue) and the same problem persists. However it only seems to happen on blocks that have a large number of fields inside them. It did not occur on a block that only had a single repeater field inside it.

    Also, it doesn’t matter what type of field is created, it will always save as a standard text field without any name or label.

    Can anyone else replicate this? (Only seems to happen on Flexible Content blocks with lots of fields and at least one repeater.)

  • What are the names of the fields that are affected. This sounds like you have 2 fields with the same name at the same level. Field names must be unique among its siblings.

  • I’ve tried several different names and labels, same problem persists.

  • I don’t know anything else except the possibility of either a field name or field key conflict.

  • Interestingly I’ve just turned on field keys and the one I’ve just added has a key of “acfcloneindex”.

    This seems to be where the problem lies, it’s adding that field key and that’s resulting in the placement/label/name not being saved and the new field being added to the end of the repeater. Presumably because it doesn’t know where else it should be?

  • That is a likely problem. Do you have any JavaScript errors happening on the page that could be interfering with the field key updating? when adding a sub field in a repeater or flex field the field key is updated in JavaScript after it is added.

  • No, nothing showing in the console.

    I’ve also tried disabling all other plugins and it still happens.

  • There was an issue like this posted here but it was never resolved and I haven’t a clue what could cause it.

  • Well it seems that suggestion there, to use the bottom button instead of the top button inside the flexible field to add child fields, is resolving the issue as far as being able to carry on working, but it’s not a permanent fix.

    Also just to note, if using the top button the added field has a placeholder label of ‘New Field’ and a placeholder name of ‘new_field’ along with the ‘acfcloneindex’ key, instead of the expected empty fields with usual generated key when using the bottom button.

    I’d be happy to supply the JSON file if you want to replicate it yourself?

  • In fact, I’ve just tried it on a third site that I’ve been asked to make a change to and it’s doing it on there too; top button is problematic, botton button is fine.

  • You should open a ticket, either through our account of by contacting the devs here

  • For anyone finding this via Google, the problem should now have been fixed in version 6.0.7, released today.

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

You must be logged in to reply to this topic.