Sitecore Logo
ASP.NET, CMS

Resolving JS conflicts between Coveo for Sitecore 4.0 and Sitecore WFFM 8

Issue:

When the user enters any keyword in coveo search box and hits search button, instead of returning results or redirecting to main search page, user will remain in same page and search does not return any result to the user.

 

Configurations:

Sitecore: Sitecore 8.1 Update 1

WFFM:  Sitecore WFFM 8.0

Coveo: Coveo for Sitecore 4.0

 

Root Cause:

Sitecore WFFM loads its own version of jQuery.  Because of this, second version of jQuery is loaded after the initial version (main jQuery of the site). When a second version of jQuery is loaded, it can affect the event queue of the Coveo search preventing Coveo from returning results to the user.

WFFM loads its jQuery in main.js file in following path.

\sitecore modules\Web\Web Forms for Marketers\mvc\main.js

 

Code block responsible for loading the jQuery
Code block responsible for loading the jQuery

 

Solution:

This can be resolved by making Sitecore WFFM to use global jQuery instead of loading its own version.

Add following piece of code in configureRequire()

define(‘jquery’, [], function() {
return jQuery;
});

And remove jquery reference in paths in main.js

      jquery: “sitecore%20modules/Web/Web%20Forms%20for%20Marketers/mvc/libs/jquery/jquery-2.1.3.min”,

 

JS File after the fix
JS File after the fix

About The Author

Leave a Reply

*