Home Forums Bug Reports Return format of "ID" type fields breaks after drag/drop into a nested field


Return format of "ID" type fields breaks after drag/drop into a nested field

  • Hi there,

    Thanks as ever for the best WordPress plugin of all time!

    I’ve experienced a bug for a while now, and thought I should let ACF know, as it’s quite niche and could have been missed.

    If you drag and drop any field that stores a post ID into a nested field type (repeater, flex content, group) the “return format” seems to always be “post ID”, even if you’ve set it to something else. This can only be fixed by changing the “return format” TO “post ID”, saving the field group, then changing it back to what you actually want. This affects fields like: image, post object, file etc (I think anything that stores an ID).

    Let me know if you need any more advice – it’s been around for more than a year, I think.

  • The reason is that you cannot take a field that is not a sub field and then make it a sub field. This causes the meta_key of the field to change and disconnects any existing data from the field. You cannot alter the hierarchy of fields unless you change all the meta_key values for the fields and the acf field key references in the database.

    This is not a bug, it’s how ACF works. You will find numerous topics here on the forum about how changing field names and recording fields in this way.

  • Hi John,

    Okay – in that case, shouldn’t drag and drop on the field group admin page be disabled to prevent people from being able to move a field inside another field, and instead only allow people to change the order of fields?

  • I thought you were talking about when editing a field group. There is nothing built into ACF that allows a field to be dragged into a sub field when editing a post and entering data into fields.

  • Yes I am just talking about editing a field group. It’s possible to drag a field inside of any group/repeater – shouldn’t that be disabled if it breaks the data upon save?

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

You must be logged in to reply to this topic.