Conflict with Divi
-
Hello,
i ran into an absolutely nervebreaking issue where the mobile Menu in my Divi Theme didn’t work anymore and took to Twitter. And one comment solved the issue, which is caused by Complianz. This should maybe be fixed in an future Update. First, here’s the Comment:
The JavaScript error I see is “ReferenceError: et_pb_custom is not defined”, triggered in Divi’s “scripts.min.js” file.
I might be wrong but it looks to me like the Complianz plugin is delaying loading of both an inline script (which defines the et_pb_custom variable) and scripts.min.js (which uses it). Presumably, this is done so that the scripts aren’t loaded until the user has accepted the Complianz terms.
Depending on how the Complianz plugin then runs these scripts, possibly this is affecting the execution order and making the et_pb_custom variable unavailable to the script. You may not be seeing this if you are logged in as admin, as presumably Complianz won’t run the same in that case.
You could test this by a) logging out or using an incognito window to hopefully let you see the issue, and b) temporarily disabling complianz (also clear lightspeed’s cache when you do) to hopefully then resolve it.
If it is Complianz that’s responsible then you may be able to solve it by excluding the inline script within the Complianz settings – I’m assuming there’s a way to do that. The inline script has the ID “divi-custom-script-js-extra”. It just sets some config variables; I don’t believe it includes user data or makes external calls), so I’d think it would be safe to exclude, from a privacy compliance point of view, but please check that against your own requirements.
[Link]
So, here’s what i did.
I used the following Snippet:
function cmplz_add_custom_whitelisted_script_tags( $whitelisted_script_tags ) { $whitelisted_script_tags[] = 'divi-custom-script-js-extra'; //'string from inline script or source that should be whitelisted' return $whitelisted_script_tags; } add_filter( 'cmplz_whitelisted_script_tags', 'cmplz_add_custom_whitelisted_script_tags', 10, 1 );And added the following scripts to the whitelist (i use my own CDN):
https://gooloode.b-cdn.net/wp-content/themes/Divi/js/scripts.min.js
https://gooloode.b-cdn.net/wp-content/themes/Divi/js/scripts.min.js?ver=4.23.1
The page I need help with: [log in to see the link]
The topic ‘Conflict with Divi’ is closed to new replies.
