Skip to content

[6.x] Fix relationship select field crashing when switching localizations - #15485

Open
duncanmcclean wants to merge 2 commits into
6.xfrom
select-field-site-switch
Open

duncanmcclean wants to merge 2 commits into
6.xfrom
select-field-site-switch

Conversation

@duncanmcclean

Copy link
Copy Markdown
Member

This pull request fixes an issue where switching an entry to another localization threw TypeError: this.options is not iterable in relationship fields using the select UI (users, terms with mode: select, etc).

This was happening because the select field's shared options cache is keyed by the site. When the site changes, the cache key changes too, and the watcher that copies cached options into the component ran before anything had been cached for the new key, so it replaced the options with undefined.

This PR fixes it by only copying options out of the cache once they've actually finished loading for the current key.

Fixes #15484
Caused by #13514

This branch has not been deployed

No deployments
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.

Switching localization throws this.options is not iterable in relationship SelectField

1 participant