Skip to content

[6.x] Fix blank term edit screen and JS error for restricted users#14537

Merged
jasonvarga merged 1 commit into6.xfrom
fix-js-error-editing-term-restricted-user
Apr 23, 2026
Merged

[6.x] Fix blank term edit screen and JS error for restricted users#14537
jasonvarga merged 1 commit into6.xfrom
fix-js-error-editing-term-restricted-user

Conversation

@joshuablum
Copy link
Copy Markdown
Member

Right now when you use the Control Panel as a restricted user (e.g. multi-site with permission to access only one site) and you try to edit a taxonomy term, you see a blank publish form and the console shows the following error:

(TypeError: this.localizations.find is not a function. (In 'this.localizations.find(e=>e.active)', 'this.localizations.find' is undefined))

The reason is that getAuthorizedSitesForTaxonomy() returns a filtered collection with non-sequential keys. Without ->values(), JSON can encode that as an object instead of an array, so the CP JS fails on this.localizations.find(...).
Adding ->values() reindexes the collection so it's an array in JSON.

Thanks to Theo for pointing out that bug through support!

@jasonvarga jasonvarga merged commit ace374e into 6.x Apr 23, 2026
30 of 33 checks passed
@jasonvarga jasonvarga deleted the fix-js-error-editing-term-restricted-user branch April 23, 2026 15:29
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