Problem/Motivation

Getting following error when running the functional JS test added in the module.

  1x: Not failing JavaScript test for JavaScript errors is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. This test had the following JavaScript errors: TypeError: Cannot set property 'human' of undefined
    at Object.attach (https://drupal9.lndo.site/modules/contrib/antibot/js/antibot.js?r54uz8:19:36)
    at https://drupal9.lndo.site/core/misc/drupal.js?v=9.3.0:27:24
    at Array.forEach (<anonymous>)
    at Object.Drupal.attachBehaviors (https://drupal9.lndo.site/core/misc/drupal.js?v=9.3.0:24:34)
    at https://drupal9.lndo.site/core/misc/drupal.init.js?v=9.3.0:29:12
    at HTMLDocument.listener (https://drupal9.lndo.site/core/misc/drupal.init.js?v=9.3.0:17:7)
TypeError: Cannot set property 'human' of undefined
    at Object.attach (https://drupal9.lndo.site/modules/contrib/antibot/js/antibot.js?r54uz8:19:36)
    at https://drupal9.lndo.site/core/misc/drupal.js?v=9.3.0:27:24
    at Array.forEach (<anonymous>)
    at Object.Drupal.attachBehaviors (https://drupal9.lndo.site/core/misc/drupal.js?v=9.3.0:24:34)
    at https://drupal9.lndo.site/core/misc/drupal.init.js?v=9.3.0:29:12
    at HTMLDocument.listener (https://drupal9.lndo.site/core/misc/drupal.init.js?v=9.3.0:17:7). See https://www.drupal.org/node/3221100
    1x in AntibotJavaScriptTest::testJavaScript from Drupal\Tests\antibot\FunctionalJavascript

Steps to reproduce

Run the functional JS test.

Proposed resolution

Work as per suggestions in the https://www.drupal.org/node/3221100.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork antibot-3256736

Command icon 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

gaurav.kapoor created an issue. See original summary.

gaurav.kapoor’s picture

Status: Active » Needs review
gaurav.kapoor’s picture

Status: Needs review » Needs work

The change which is introduced in the MR, does fix the error which is shown when running tests and all tests pass as well. Not sure, what's causing them to fail here.

daniel korte’s picture

This JS error also shows up on the /antibot page itself.

gaurav.kapoor’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
joegraduate’s picture

I think this is actually a duplicate of #3205217: drupalSettings not updated on rendering form in Ajax and could be fixed by the existing patch on that issue (#3205217-4: drupalSettings not updated on rendering form in Ajax).

danrod’s picture

Assigned: Unassigned » danrod
danrod’s picture

Status: Needs work » Active
danrod’s picture

I think this can be merged into the 2.0.x branch, need to fix some ESLINT errors.

danrod’s picture

Status: Active » Needs review
danrod’s picture

Needs some review, just in case anyone wants to have a look on this.

danrod’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.