Skip to content

[5.x] Fix relationship-based fields showing raw ids after saving#14936

Open
mynetx wants to merge 1 commit into
statamic:5.xfrom
mynetx:fix/relationship-stale-item-data-5x
Open

[5.x] Fix relationship-based fields showing raw ids after saving#14936
mynetx wants to merge 1 commit into
statamic:5.xfrom
mynetx:fix/relationship-stale-item-data-5x

Conversation

@mynetx

@mynetx mynetx commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

When you type a new term into a terms field (max_items 1, select or typeahead mode) and save, the field switches to showing the raw id (e.g. tags::bob) instead of the label until you reload. The publish form resets the values from the save response, where the typed text has been normalized to a taxonomy::slug id — but the relationship input's item data is never refreshed, so it can't resolve a title for the new id and falls back to displaying the id itself.

This makes the relationship input refetch its item data whenever the value references items it has no data for. That also heals the other stale-item-data paths reported in the issue (e.g. inside grids), since the input now recovers by itself instead of relying on the meta staying in sync.

Fixes #14785

When the publish form resets values from a save response, ids may come back in a
different form than what the client selected — most visibly when typing a new
term into a single-term select field, where the typed text gets normalized to a
taxonomy::slug id the component has no item data for. The item then renders its
raw id instead of its title until a full reload. Refetch item data whenever the
value references items missing from it.
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