This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Radu 1 month, 3 weeks ago.

Assigned support staff: Radu.

Author Posts
August 27, 2019 at 8:01 pm #4469569

brianG-6

Hello,

I'm trying to use Gravity Forms' Advanced Post Creation add-on, and I'm not able to because an error is being thrown from select2.min.js in the WPML plugin. The exact error is, 'Uncaught Error: Option 'ajax' is not allowed for Select2 when attached to a <select> element.' I saw a few support tickets from 2018 referencing this, and it was supposedly fixed. However, I have all of the latest versions of everything, and it's not working. The Gravity Forms plugin does work properly when I disable WPML, so I know that it's definitely related to that.

August 28, 2019 at 4:32 am #4471127

Radu
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hey Brian,

Thank you for reaching out the WPML support!

I checked this out and it seems that this issue with the Advanced Post Creation add-on is already on our list.

Our team has discovered that it is a JS library that creates conflict with gravity forms because gravity forms is also loading it.

While working on a permanent solution to the problem, they gave me a function that you need to insert in the functions.php file:

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);

Remember to remove it if you disable Gravity Forms in the future, to avoid problems. Just give this a try and tell me if things are working better this time.

Thanks,
Radu

The topic ‘[Closed] Conflict with select2 js file’ is closed to new replies.