stopped working after adding cookie consent JS

Created on 22 November 2021, over 2 years ago
Updated 19 June 2024, 9 days ago

Problem/Motivation

adding below code in head section
<script id='BBCookieConsentRur' data-language="en" type="text/javascript" data-bbcid="testedwith-f544-4925-9a02-c6104bbb4321" src="https://2badvice-cdn.azureedge.net/psf/js/bb-manager.js"></script>

returns below message while user login

'You have reached this page because you submitted a form that required JavaScript to be enabled on your browser. This protection is in place to attempt to prevent automated submissions made on forms. Please return to the page that you came from and enable JavaScript on your browser before attempting to submit the form again.'

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India sanoopuio

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇪Belgium weseze

    This is a cookiebot issue, not an antibot issue.

    You can try and bypass the issue with this custom code in a custom module:

    /**
     * Prevent cookiebot from blocking antibot. (testing code: to evaluate)
     *
     * Implements hook_library_info_alter().
     */
    function MY_MODULE_library_info_alter(&$libraries, $extension) {
      if (isset($libraries['antibot.form'])) {
        $libraries['antibot.form']['js']['js/antibot.js']['attributes'] = ['data-cookieconsent' => 'ignore'];
      }
      if (isset($libraries['drupalSettings'])) {
        $libraries['drupalSettings']['js']['misc/drupalSettingsLoader.js']['attributes'] = ['data-cookieconsent' => 'ignore' ];
      }
      if (isset($libraries['drupal'])) {
        $libraries['drupal']['js']['misc/drupal.js']['attributes'] = ['data-cookieconsent' => 'ignore'];
      }
    }
    

    However, the better solution is to disable auto-blocking mode in cookiebot and handle JS files which set cookies properly from within Drupal.

Production build 0.69.0 2024