Problem/Motivation
Drupal 11 ships jQuery 4.0, which removed the deprecated `$.isFunction()` helper. `js/cookieContentBlocker.js` still uses it in `loadBlockedAssets()`:
```js
$.each(Drupal.behaviors, function (name, behavior) {
if (!originalBehaviors[name] && $.isFunction(behavior.attach)) {
behavior.attach(document, window.drupalSettings);
}
});
loadBlockedAssets() is called from handleConsent() on every attach() as soon as consent is stored in the cookie, regardless of whether the page contains blocked content. So on Drupal 11 every page load for a visitor who already gave consent throws:
Uncaught TypeError: $.isFunction is not a function
Because the exception is thrown inside the module’s own attach(), attachConsentEventListeners() and attachConsentEventTriggers() never run for that page: the consent-change buttons get no handlers, and behaviors are not re-attached to unblocked content. We see this in production monitoring (Microsoft Clarity) on a Drupal 11.3 site with cookie_content_blocker 2.6.1, about one second after page load.
Steps to reproduce
Install Drupal 11 with cookie_content_blocker 2.6.1 and configure the consent cookie.
Give consent so the accepted cookie is set.
Load any page (blocked content is not required) with the browser console open.
The console shows TypeError: $.isFunction is not a function immediately after load.
Issue fork cookie_content_blocker-3633463
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
aras.drupal commentedComment #4
sjerdoLGTM +1
Comment #6
sjerdo