wp-shortcake / shortcake

Shortcake makes using WordPress shortcodes a piece of cake.
GNU General Public License v2.0
665 stars 144 forks source link

JS Error with ACF Pro #733

Open pressoholics opened 7 years ago

pressoholics commented 7 years ago

When using ACF Pro repeater field a JS error is generated when the user clicks on the ACF button to add a new repeater row:

https://cl.ly/3K2P2S0d0j2s acf-pro

Only 2 plugins active are:

ACF Pro v5.5.13

Shortcake v0.7.2

goldenapples commented 7 years ago

Question: are you using the SELECT2_NOCONFLICT mode? If not, can you try defining the constant flag which enables that mode, and see if it clears up the problem?

The method $.select2('destroy') method belongs to the Select2 API from version 3.x. We're enqueueing Select2 at 4.0.3, so the ACF plugin isn't getting the version of the library it expects to be loaded. Defining the "noconflict" flag will allow both both versions of the library to be loaded in separate namespaces.

htrex commented 6 years ago

ACF Pro v.5.6.0 Updated Select2 JS library to v4 Changelog > https://www.advancedcustomfields.com/blog/acf-pro-5-6-0-update/

htrex commented 6 years ago

@goldenapples after some testing with ACF >= 5.6.0 I'm not seeing this issue anymore, I think you can close it.