Home Forums Feature Requests Maintain data relationships, or migrate data, when moving fields into Groups


Maintain data relationships, or migrate data, when moving fields into Groups

  • Hello,

    Correct me if any of my information is wrong…

    When moving existing ACF fields, that have already had data input, into the ‘Sub Field’ area of a ‘Group’ field, any existing data relationships break. Essentially a new field has been created in the back-end, however in the front-end the moved field still has the same ‘Field Name’.

    Note: Any reference to ‘Group’ is in regard to the field type ‘Group’, not the parent “Field Groups” presented in admin/Custom Fields/Field Groups.

    In my situation: I’m a new ACF user. I put together about 30 fields and inputted 50 posts, populating those fields. Everything works; posts render fine. Looking back at the ACF field list, it’s a blizzard of items, so like any plain user, to be more organized I started creating field Groups and dragging fields into them. After this, I saw my posts not rendering my custom field data… why? After looking I find that there’s new field instances inside my database, which are empty; the result of my dragging fields into Groups. My data still existed in the DB, but only in relation to the original field positions in the ACF field list (ie not in my field groups). Dragging my fields back out of the Groups, to their original positions, fixed my post rendering, but now I still have the issue of a messy field list.

    People wishing to move fields into field groups, are given various recommendations to handle the resulting ‘data disconnect’:
    1. Re-input all your data into the new sub-fields
    2. Or manually migrate data from the old fields to the new sub-fields, by running SQL queries on the database
    3. Or make an XML export of your Field Group, make edits accordingly, and import the edited XML
    4. Or develop conditional functions in PHP to account for new and old data.

    None of which is appealing.

    REQUEST: When a user drags a field into a Group ‘Sub Field’ area, any associated data relationships should be automatically handled somehow, or at the very least provide a tool that can do this — OR — alternatively offer a way to organize the field list, in standard modern ways, without affecting the data model.

    REQUEST 2: Somehow it needs to be communicated to the user that such changes actually change data relationships. How would a user know? Perhaps I overlooked some messaging somewhere? There was certainly no prompt, anyhow. I’m experienced, and this was not expected. Perhaps some of the ACF user base already knows this, perhaps not. In any case, you have to assume the worst.

Viewing 1 post (of 1 total)

The topic ‘Maintain data relationships, or migrate data, when moving fields into Groups’ is closed to new replies.