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

Determine select2 version from ACF instead of guessing from ACF version #105

Merged
merged 1 commit into from
Oct 30, 2017

Conversation

kraftner
Copy link
Contributor

fixes #79

This could probably still be improved as the case of ACF5 with select2 v3 is now not actually covered by the tests. But for that I am waiting for #103 because it will add the infrastructure to add a CPT for which we could then switch select2 to v3.

@@ -688,7 +688,7 @@ Scraper.prototype.scrape = function(fields){

if( field.$el.find('.acf-taxonomy-field[data-type="multi_select"]').length > 0 ){

var select2Target = (helper.acf_version >= 5.6)?'select':'input';
var select2Target = (acf.select2.version >= 4)?'select':'input';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, it is nicer to have a global minimalRequiredSelect2Version variable that contains the number 4, that is easier to read than only using a magical 4 value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm...The things is that

  1. This isn't a minimal required version, but rather a switch to work with any select2 version.
  2. The number is compared to acf.select2.version, so isn't it pretty obvious that this is the select2 version?

@andizer
Copy link
Contributor

andizer commented Oct 23, 2017

CR done. I've one single suggestion.

@moorscode
Copy link
Contributor

Acceptance done

@moorscode moorscode merged commit 6019262 into develop Oct 30, 2017
@moorscode moorscode deleted the stories/select2-compatibility branch October 30, 2017 15:24
@moorscode moorscode modified the milestones: 2.0.1, 2.1 Oct 30, 2017
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.

Possibly incomplete fix for select2 issue
3 participants