Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Tags - Post Meta Field Key names are being modified #1774

Open
diggeddy opened this issue Feb 19, 2025 · 3 comments
Open

Dynamic Tags - Post Meta Field Key names are being modified #1774

diggeddy opened this issue Feb 19, 2025 · 3 comments
Labels
bug Bugs, unexpected and weird behaviors
Milestone

Comments

@diggeddy
Copy link
Collaborator

diggeddy commented Feb 19, 2025

Description

Multiple meta keys with names that:

a) contain underscores
b) start the same e.g

parent_key
parent_key_subfield
parent_key_subfield_subfield

Dynamic tags is replacing secondary underscores with a dot (.)

Here are some examples using ACF fields

toolbar_options
toolbar_options_photo => toolbar_options.photo
toolbar_options_photo_description => toolbar_options.photo_description
Image Image
@diggeddy diggeddy added the bug Bugs, unexpected and weird behaviors label Feb 19, 2025
@iansvo
Copy link
Collaborator

iansvo commented Feb 19, 2025

@diggeddy The real reason this is happening is because we assume that keys named in this way are group fields. In ACF terms, if you had a group called la_bamba and then had a subfield called bazinga the stored name is: la_bamba_bazinga. We currently determine this by simply checking the name, instead of a more robust solution that would check the field type or something like that. This type of thing can probably be done better but it should hopefully be relative simple to do.

@codysmith44
Copy link

@iansvo I discovered this and was talking to Ying about it via email. The reason I do this is because sometimes I'll use the same field name across different field groups, and this makes it easier for me to identify, sort of like a prefix for where things belong. I rarely use group fields (subfields) and didn't think about the consequences of how ACF subfields work/store names.

For now I've just been manually changing the '.' to an underscore - not a huge deal but would be nice if the system just worked. Thanks!

@diggeddy
Copy link
Collaborator Author

@codysmith44 we will review and remove or correct our "assumptions" so it does just work as it should.
Thanks for bringing the issue to our attention.

@diggeddy diggeddy added this to the 2.1.0 milestone Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs, unexpected and weird behaviors
Projects
None yet
Development

No branches or pull requests

3 participants