Skip to content

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

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

[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.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mynetx mynetx force-pushed the fix/relationship-stale-item-data-5x branch from 6df75c0 to e48f7cb Compare July 6, 2026 08:33
@jasonvarga

Copy link
Copy Markdown
Member

Thanks but bug fixes are no longer going to 5.x.

@mynetx

mynetx commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Reopened against 6.x here: #14948

Turns out the value watcher alone wasn't enough. Verifying it in a real browser turned up a second bug in the Combobox component that also needed fixing for the label to actually stay correct after save. Details in the new PR.

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.

2 participants