- 🇦🇹Austria drcolossos
Huge respect for finding the root of the problem! We got stuck at the same problem. The patch from #56 seems to solve the problem in a very nice way. This really should be pushed forward to be able to get into dev.
BTW: Cookiebot should not rely on third-party libraries being available on the site. This seems like a huge design problem.
- 🇬🇧United Kingdom SoulReceiver
This patch works great, but when we use it we found that on every page request where the user has not yet approved or denied the use of cookies, the console was being filled with this error:
Uncaught TypeError: Cannot read properties of undefined (reading 'get')
Which relates to this line in the original JS:
if (Cookiebot.consent[cookieName] === true && cookies.get('cookiebot-consent--' + cookieName) !== '1') {
Seems when the attachBehaviours runs we do not have the derived cookies object from the window.Cookies. Played around with this and if adding this condition to the others seemingly solves the issue, and it doesn't seem to affect the functionality of when the cookies are either approved or denied in our current implementation:
if (typeof Cookiebot === 'undefined' || Cookiebot.consent === void (0) || typeof cookies === 'undefined') { return; }
Added the fix as a new patch, but would appreciate it if it could be more broadly tested.
- 🇬🇧United Kingdom John Cook
I've tested the patch in #58 🐛 Blockmode "Auto" will not work in Drupal 8 with core's domready library Needs work and it works as expected.
I've check the patch and it doesn't appear that @dmsmidt's points in #43 🐛 Blockmode "Auto" will not work in Drupal 8 with core's domready library Needs work have been addressed. This will need to be done before this can proceed further.
- 🇳🇱Netherlands tim_dj Netherlands
This patch addresses the following from #43:
Did you write es6 first and than transpiled? Doesn't look like you did.
I've removed the non-es6 javascript. This is no longer required since D10: https://www.drupal.org/node/3305487 →
You should never call jQuery directly like this. Use the scoped version from the self invoking function $.
Using
$(function() {
nowThis is not confirm coding standards.
Updated the referenced lines
This should be drupalSettings right?
Removed using drupalSettings completely in this function call since attachBehaviours() defaults to drupalSettings if no settings variable is provided.
I did add core/drupalSettings to dependencies because that was missing and drupalSettings are used elsewhere in this js
so if autoblocking is off, this still gets set to 'true', while it is not true.
Renamed the function to provide better insight in what it does. It does not seem to depend on autoblockingmode.
- 🇧🇪Belgium BramDriesen Belgium 🇧🇪
Let's make an issue fork as it's easier to work on and review.
- Merge request !25#3091260 Blockmode Auto will not work in Drupal 8 with core's domready library → (Open) created by tim_dj
- 🇳🇱Netherlands tim_dj Netherlands
@bramdriesen Created MR. This MR is the same as patch in #60