Home Forums Feature Requests Allow Field Groups to override local JSON storage during form output


Allow Field Groups to override local JSON storage during form output

  • Hi ACF team, Thanks for the great plugin.


    When a plugin provides an ACF field group with JSON, the UI breaks a WP user’s expectations because they can still edit the field group through the ACF UI, but their changes are not shown during form output.

    1. Create plugin that includes ACF field group as JSON. That field group has a single field with the label “Company Name”
    2. Enable the plugin and sync the field group
    3. Edit the field in that group and change the label from “Company Name” to “Some Other Field Label”. Save the field group.
    4. View the form, and the old label “Company Name” is shown. This is because ACF allows “local” (JSON) to override the database during form output.

    This creates a lot of confusion for my intended workflow. I would expect that after giving a client a custom plugin, they can edit the fields themselves to improve the field labels, descriptions, etc. Then I would re-export their changes and update the plugin. If the client breaks the field group terribly they can trash it and re-sync the JSON, so that the JSON serves as a backup to the database field settings.

    Potential Solution:

    1. One way to solve this would be to just disable the UI for “local” JSON managed fields and field groups. This would prevent the confusion, but I could foresee clear limitations during development.
    2. Another solution is to provide a mechanism that allows the database field/group settings to override the local JSON file. I propose this one, as it would allow the developer and client to work together on the form fields for better results.

    I’ve created a patch for the second solution as a gist.

    This patch adds a new setting per field_groups called “db_overrides_local_output”. When enabled, the field group will be shown as it exists in the database, as opposed to being overridden by the JSON file. This patch supports backwards compatibility needing to be enabled per field group for it to have an effect.

    Here is a screenshot of the new settings field on a field group’s edit page.

    Thoughts / feedback / a better way?

    Thanks again,

    Unrelated side note: I just lost 45 minutes typing out this feature request with much more description. I scrolled up to re-read it, and your site header appear right as I clicked. poof all gone.

  • Hi @daggerhart

    Thanks for the post.

    Would you mind opening a support ticket instead and copying over this information?

    This will make you feature request get to the plugin author faster.

    Please create the support request at [email protected]

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

The topic ‘Allow Field Groups to override local JSON storage during form output’ is closed to new replies.