afform: select2 bug on WordPress when anonymous
On public WordPress pages, as an anonymous user, select2 fields do not render correctly.
To reproduce:
- Install afform on WordPress stable
- Use a fairly modern theme, such as TwentyTwentyOne
- Create a new afform
- Allow access to anonymous users
- Add an individual and the "individual prefix field"
- Access the form as an anonymous user
Result:
JavaScript error: "TypeError: t.indexOf is not a function"
If I am authenticated, as an admin, using the jquery-migrate-helper plugin, it works:
If I apply PR20825, it renders, but the list of options is empty: