Resolved
Resolved in: WPML 4.4.4
Overview of the issue
While using Gravity Forms Advanced Post Creation Add-On with WPML, specifically on the Post Creation screen. You might encounter some issues such as the drop-down menus and buttons not being responsive.
In the browser console, you’ll find a few JavaScript errors such as
1 2 3 4 5 6 7 8 9 10 11 | Uncaught Error: Option 'ajax' is not allowed for Select2 when attached to a <select> element. at String.<anonymous> (select2.min.js?ver=4.3.12:21) at Function.each (load-scripts.php?c=1&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.4.1:2) at d.prepareOpts (select2.min.js?ver=4.3.12:21) at d.prepareOpts (select2.min.js?ver=4.3.12:22) at d.init (select2.min.js?ver=4.3.12:21) at HTMLSelectElement.<anonymous> (select2.min.js?ver=4.3.12:22) at Function.each (load-scripts.php?c=1&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.4.1:2) at a.fn.init.each (load-scripts.php?c=1&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.4.1:2) at a.fn.init.a.fn.select2 (select2.min.js?ver=4.3.12:22) at HTMLDocument.<anonymous> (form_settings.min.js?ver=1.0-beta-4:1) |
and
1 2 3 4 5 6 7 8 9 10 11 | Uncaught TypeError: Cannot read property 'hasClass' of undefined at HTMLDocument.<anonymous> (load-scripts.php?c=1&load[]=thickbox,hoverIntent,common,admin-bar,svg-painter,wp-auth-check,jquery-ui-datepicker,jquery-effects-core,jquery-effects-shake&ver=5.1.1:585) at HTMLDocument.dispatch (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=5.1.1:3) at HTMLDocument.r.handle (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=5.1.1:3) at Object.trigger (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=5.1.1:3) at Object.a.event.trigger (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=5.1.1:8) at HTMLDocument.<anonymous> (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=5.1.1:3) at Function.each (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=5.1.1:2) at a.fn.init.each (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=5.1.1:2) at a.fn.init.trigger (load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=5.1.1:3) at Object.<anonymous> (heartbeat.min.js?ver=5.1.1:1) |
Workaround
We are working on a more permanent fix for this issue, but at this moment you can use the following workaround:
Add this snippet to your theme’s functions.php file – please remember to backup your WP install before you do that.
1 2 3 4 5 6 7 | add_action( 'admin_enqueue_scripts' , function (){ if (wp_script_is( 'gform_advancedpostcreation_select2' )) { add_action( 'wp_after_admin_bar_render' , function (){ wp_dequeue_script( 'wpml-select-2' ); }, 99); } }, 99); |