AdvancedCustomFields / AdvancedCustomFields/acf
Cannot read property 'indexOf' of undefined when adding Google Map field on taxonomy
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
WordPress 5.8
ACF Pro 5.9.x or 5.10
As one of our customer reported a similar error on one of our plugins, it still have a javascript error with ACF when we add a Google Map field on taxonomy like post category for example.
Steps to reproduce
- Add an ACF field group with a Google Map field
- Add a rule to use this field on Forms/Taxonomy/Category(category)
- Go to Posts > Categories
- See the fatal javascript error which stucks the code execution behind the code in error

Why
It seems Google Map ajax request doesn't send any data property and so isn't defined while applying the indexOf method at https://github.com/AdvancedCustomFields/acf/blob/5.9.6/includes/forms/form-taxonomy.php#L301
There is also the same kind of error at https://github.com/AdvancedCustomFields/acf/blob/5.9.6/includes/forms/form-taxonomy.php#L306 because Google Map ajax request never returns responseText property.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with includes/forms/form-taxonomy.php around lines 301 and 306, then reproduce the Google Map field on a taxonomy category as described. Check the AJAX response handling when data and responseText are absent; done means the fatal JavaScript error no longer stops the taxonomy form.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- backend, frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100