Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select2 problem with ACF5 and Taxonomy multi-select field #26

Closed
moorscode opened this issue Aug 2, 2017 · 7 comments
Closed

Select2 problem with ACF5 and Taxonomy multi-select field #26

moorscode opened this issue Aug 2, 2017 · 7 comments
Labels
Milestone

Comments

@moorscode
Copy link
Contributor

Whenever a Taxonomy field is created, with multi-select as appearance, the following error is thrown:

The select2('data') method was called on an element that is not using Select2.

This is breaking all functionality, and no more data is parsed by the code.

Specifically for branch: https://github.com/Yoast/yoast-acf-analysis/tree/features/acf-5

/cc @kraftner

@moorscode moorscode added the bug label Aug 2, 2017
@moorscode moorscode added this to the 2.0 milestone Aug 2, 2017
@kraftner
Copy link
Contributor

kraftner commented Aug 3, 2017

I haven't looked into this yet, but is this with ACF4 or ACF5 Pro? What about the tests?

@moorscode
Copy link
Contributor Author

This was tested with ACF5 (see title).
This was breaking while testing it in the WordPress install myself.
This also showed up in the tests with the taxonomy field configured.

richardsweeney pushed a commit to richardsweeney/yoast-acf-analysis that referenced this issue Aug 9, 2017
@kraftner
Copy link
Contributor

kraftner commented Aug 11, 2017

After some investigation it seems that this broke with ACF 5.6 and the switch from select2 v3 to v4.

As already said in #38 I think we now have to decide if the either up the ACF PRO requirement to >=5.6 or if we attempt to fix this in a way that is compatible with all versions.

Personally, especially because we're not talking about some very old version but the most recent one, I'd say we need to make this work post and pre 5.6.

@kraftner
Copy link
Contributor

Okay this turned out to be less difficult as expected. As we already have the ACF version in JS I just call select2 differently depending on the ACF version. I've opened a new PR #45 that should fix this issue.

@kraftner
Copy link
Contributor

Closed via #45

@Anderrs
Copy link

Anderrs commented Jan 18, 2018

I can confirme that this is still a bug.
It's not really an option to change to Select2 version 3 since a lot of other things break then.

@kraftner
Copy link
Contributor

@Anderrs This is fixed via #105 which isn't released on .org yet though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants