AdvancedCustomFields / AdvancedCustomFields/acf
Select2 fields not working with two `acf_form`s on the same page
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Hi!
I've run into an issue with duplicate forms that affects both my own plugin Advanced Forms and the built-in acf_form. The issue occurs when you have two instances of a single acf_form on the same page and the forms contain a select2 field of some kind. In my case, I have a taxonomy field and only the last occurrence of the field is properly initialized:
Steps to reproduce
- Create a new field group and add a taxonomy field
- Create two forms for this field group on the same page using
acf_form - The first taxonomy field won't be properly initialized
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 by reproducing the issue with two acf_form instances containing the same taxonomy or other Select2 field on one page. Trace how acf_form renders the fields and how Select2 initialization targets them; done means both form instances initialize their Select2 fields correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100