Skip to content

fix(rawir): ACF rows leave under field names (0.6.1) - #44

Merged
ABB65 merged 1 commit into
mainfrom
fix/acf-row-names
Oct 2, 2026
Merged

ABB65 merged 1 commit into
mainfrom
fix/acf-row-names

Conversation

@ABB65

@ABB65 ABB65 commented Oct 2, 2026

Copy link
Copy Markdown
Member

ACF returns unformatted repeater/group/flexible rows keyed by sub-field key (field_5f3…); REST gives names. Source::acf_value now renames row keys to sub-field names recursively (repeater, group, flexible, nested). A field_* key no sub-field owns stays as is and is reported as acf-key-unmapped. Tests: repeater, group+nested, flexible, unknown key; integration suite 388 checks pass. Version and changelog 0.6.1.

…ames (0.6.1)

ACF returns unformatted rows keyed by sub-field key; they now come out under names at every depth, like the REST API. A field_* key no sub-field owns stays as is and is reported as acf-key-unmapped.
@ABB65

ABB65 commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

ONAY on ea3b6a8 (t2).

Checked against the code, not the description:

  • Recursion: acf_value renames row keys to sub-field names and recurses through each sub-field's own definition, so repeater → group → repeater and flexible rows are covered. Tests cover repeater (keyed + already-named rows), group with a nested repeater, and flexible. The flexible acf_fc_layout marker is not a field_* key and is kept uncounted.
  • Unresolved keys: a field_* key no sub-field owns keeps its cell and its key (no invented name) and adds acf-key-unmapped. That entry is not swallowed: post records pass $excluded to Jobs::warning, and Models::options_page does the same for options pages, so both land in bridge/warnings.json and counts.warnings. (Coverage::post_meta only reads post/<id>/… sources, so it ignores these entries; that is fine for a warning.)
  • Secrets: the sensitive-field check still runs before renaming, so a secret-named sub-field is dropped under both its key and its name.
  • Changelog and version: header, CONTENTRAIN_BRIDGE_VERSION and Stable tag all say 0.6.1. The changelog matches the code: posts and options pages both go through acf_value, and an unowned key is "kept as it is and reported". No tag or release step is in the PR.
  • CI: green on this SHA (small, small (10), acceptance, plugin metadata, PHP 7.4/8.3 syntax). I could not run the PHP suite locally (no php here), so I'm relying on CI for that.

Non-blocking, for a later release:

  1. A flexible field merges every layout's sub-fields into one by_name map, so a name shared by two layouts with different types resolves to the last layout. Rows keyed by key (the Bridge path this PR fixes) are unambiguous. Choosing the layout from acf_fc_layout would remove the ambiguity for already-named rows.
  2. If one row held both a key and its name for the same sub-field, the later cell overwrites the earlier silently. ACF doesn't produce that shape, so I'm only mentioning it.

@ABB65
ABB65 merged commit 11cf3a6 into main Oct 2, 2026
8 checks passed
@ABB65
ABB65 deleted the fix/acf-row-names branch October 2, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant