Closed waustin closed 4 years ago
@waustin I believe the issue is with ACF itself. When saving values to the post_meta table in the database, it uses the ACF field name as the meta_key, not the ACF field key.
I just tried this using the ACF UI to double check, two field groups with 1 field each named title and it only saves the last value.
@stevep I think you are correct.
Reading the StoutLogic docs on Generated Keys made me think it there would not be field collision. I've started wrapping fields in a Group Field and that seems to prevent ACF overwriting stuff.
Thank You for the response and the awesome library. It makes working with ACF some much nicer.
@waustin I've started to do the same thing in my projects in some cases
i had the same issue. i was able to fix this by adding the key to the FieldsBuilder instantiation, like this:
$project_data = new FieldsBuilder('Project data', ['key' => 'project_data']);
I have 2 different field groups on a page, both have the field named title
If I var_dump the block the field is being created with a unique keys
However when I edit the page in the admin. WP / ACF is only using the "last" defined field on the page. It acts like the keys are not unique.
I am running a new WP / Bedrock install.
ACF Builder "1.9.0" ACF Pro: 5.8.11