Issue: The use of 'ajax' option is restricted for Select2 when connected to an <input> element - Following the update to version 3.1.2

After updating the WooCommerce version to 3.1.2, I encountered an issue while trying to add or edit a variable product. An error message "

Uncaught Error: Option 'ajax' is not allowed for Select2 when attached to a element.
" appears when selecting a product attribute or variation.

Uncaught Error: Option 'ajax' is not allowed for Select2 when attached to a <select> element.
    at String.<anonymous> (ultimate-woocomposer-backend.min.js:1)
    at Function.each (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-menu,wp-a11y,jquery-ui-autocomplete,underscore,backbone,wp-util,wp-backbone,media-models,plupload,jquery-ui-tooltip&ver=4.8.1:2)
    at d.prepareOpts (ultimate-woocomposer-backend.min.js:1)
    at d.prepareOpts (ultimate-woocomposer-backend.min.js:2)
    at d.init (ultimate-woocomposer-backend.min.js:1)
    at HTMLSelectElement.<anonymous> (ultimate-woocomposer-backend.min.js:2)
    at Function.each (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-menu,wp-a11y,jquery-ui-autocomplete,underscore,backbone,wp-util,wp-backbone,media-models,plupload,jquery-ui-tooltip&ver=4.8.1:2)
    at a.fn.init.each (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-menu,wp-a11y,jquery-ui-autocomplete,underscore,backbone,wp-util,wp-backbone,media-models,plupload,jquery-ui-tooltip&ver=4.8.1:2)
    at a.fn.init.a.fn.select2 (ultimate-woocomposer-backend.min.js:2)
    at HTMLSelectElement.<anonymous> (wc-enhanced-select.min.js:1)

Refer to the screenshot below;

https://i.stack.imgur.com/nYpjJ.jpg

I have searched for a solution online but couldn't find one. Most sources suggest it may be a bug (though I am uncertain).

Your assistance in resolving this issue would be greatly appreciated.

Best regards

Answer №1

It's been a while since I encountered this issue, but I wanted to share my solution in case it helps someone else who may be facing the same problem. I was experiencing a persistent error with the attribute section being stuck in a loop, which was also showing up in the console.

Here's what I tried: I first attempted to disable a commonly known conflicting plugin that matched the symptoms I found online.

  1. I disabled Yoast SEO (although this did not resolve the issue for me, so I re-enabled it)

  2. I turned off Visual Composer, a page builder plugin, and specifically deactivated "Ultimate_VC_Addons". This finally fixed the problem with the attribute section.

  3. I suspected a theme conflict, so I switched back to the default Wordpress theme to investigate further.

  4. If Advanced Custom Fields is causing the conflict, you can refer to this helpful thread.

  5. If none of these solutions work, consult the Woocommerce documentation for additional troubleshooting tips.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Laravel Ajax error when trying to insert datepicker value into the database

Hey everyone, I'm having trouble inserting a value into a datepicker. When I use my ajax code to do this, it returns null. Here's the code: <script type="text/javascript"> // add a new post $(document).on('click', '. ...

Stop jQuery from adding duplicate values to a table

When I make an AJAX call using jQuery and PHP to receive JSON response, I am encountering a problem with duplicate values. The code is functioning correctly, but when selecting an option from the drop-down list, duplicate entries appear. The scenario invol ...

Troubleshooting: Jquery ajax request not functioning on Android emulator

Attempting to call a webservice using jQuery ajax. Utilizing jsonp as a datatype to address cross domain issues. All browsers are functioning properly. Tested on different domains and receiving valid responses. However, encountering failures when trying t ...

Optimizing Wordpress by Efficiently Enqueueing Javascript

As a beginner with a WordPress website, I am aware that in order to execute scripts on a WordPress page, they need to be enqueued in the functions.php file. However, I'm unsure about the correct process for this. The specific JavaScript file I want t ...

Filtering categories on a multisite posts query in WordPress

Exploring a New Challenge As a newcomer to custom SQL queries, I am navigating through uncharted territory. Currently, I manage a multisite setup with numerous blogs. A particular function successfully extracts the latest posts from all these blogs. The ...

``There seems to be an issue with the redirect header function in the PHP

Setting up my test site on a local host, I included an ajax request in one of my java-script files to a php script. if(hIF == "true"){ $.ajax({ type: "POST", url: "log_in/login.php", data: {name: userName, pwd: password}, ...

Obtain pictures from Google image search using Python

As a newcomer to web scraping, I initially turned to https://www.youtube.com/watch?v=ZAUNEEtzsrg for guidance on downloading images with specific tags (e.g. cat), and it proved successful! However, I have encountered a new issue where I can only download a ...

When utilizing AJAX, certain web pages may contain a querystring

Encountering an issue with ajax when using query strings. Data can be successfully sent when the page does not have any query string and Info.aspx/Save works perfectly fine. However, when I include query strings and post the same data, it results in a HTTP ...

JavaScript struggles when dealing with dynamically loaded tables

I am currently working on integrating the javascript widget from addtocalendar.com into my website. The code example provided by them is displayed below. Everything functions as expected when I place it on a regular page. However, I am facing an issue wher ...

Switching between pages and updating the URL without needing to refresh the page, while still maintaining the content even after a refresh

After experimenting with jQuery's load() method to dynamically change content without refreshing the page, I encountered a recurring issue: the URL remains unchanged. Even when attempting to use history.pushState() to modify the URL, the problem pers ...

Utilizing $.post() for XSS attacks through a bookmarklet

I have a burning question that I need help understanding. Can someone clarify why it is possible to request a page using a bookmarklet with the following code: javascript:var%20s=document.createElement('script');var data=encodeURI(location.href) ...

The Symfony parameter for security, known as "json_login", fails to initialize the controller

I followed the tutorial on Symfony's documentation titled "How to Create an Authentication Endpoint using JSON in Symfony". However, I encountered a problem when making an AJAX call at my login handler. Instead of successfully logging in, I received a ...

What is the process of matching a server response with the appropriate pending AJAX query?

Imagine a scenario where my web app utilizes AJAX to send out query #1, and then quickly follows up with query #2 before receiving a response from the server. At this point, there are two active event handlers eagerly waiting for replies. Now, let's ...

Deleting a zip file using PHP: A step-by-step guide

After downloading the 17111611185.zip file in my project using ajax, I need to remove it from my Linux server. To achieve this, after redirecting with window.location=data, another ajax call is made to pass 17111611185.zip back to the server. $.ajax({ ...

Issue with Ajax filtering on the frontend of October CMS (Uncaught TypeError: $form.request is not a function)

I'm currently working on integrating a price filter into my October CMS project using AJAX on the frontend. However, I keep encountering an error stating (Uncaught TypeError: $form.request is not a function) whenever my JavaScript code is executed. $( ...

Track and display the number of times a button is clicked using

I'm looking to create a button click counter that changes the text on the button when clicked. I want to write this information to a database as well, but I'm struggling with the implementation. <button type="button" class="btn btn-info" styl ...

Sending an AJAX associative array to a PHP associative array

I'm currently attempting to transmit form values to PHP utilizing the $.ajax method. Here is the HTML form structure I am working with: <form> <p> <label for="login">User ID:</label> <input type="text" name="login" id ...

What is the best way to automatically refresh a page every minute using ajax?

Is there a way to automatically update a specific div on my page with the minute of the match every 15 seconds? I want to refresh only that particular area where the div is located. <script> setInterval(function () { ...

Learn how to utilize JQuery for downloading a file or incorporate Ajax to showcase an error page

I am currently developing a single-page application utilizing ASP.Net Core MVC and JQuery. Due to the fact that full-page refreshes would reset some lengthy processes, I have opted to implement AJAX for all navigation tasks. One of the functionalities I a ...

What is the best method for passing a JavaScript object to PHP using Ajax?

I have looked into similar questions like this and this, but none of them have helped me solve my issue. When I check the console log for my data, it displays the following: Object["row_LM#00000010", "row_LM#00000002", "row_LM#00000009", "row_LM#00000008" ...