Problem/Motivation
We need to replace jQuery.once() with javascript once() in Drupal 10.
Error in hubspot_integration.js file
Uncaught TypeError: $(...).once is not a function
at Object.attach (hubspot_integration.js?v=1.x:4:26)
at drupal.js?v=10.0.10:166:24
at Array.forEach ()
at Drupal.attachBehaviors (drupal.js?v=10.0.10:162:34)
at drupal.init.js?v=10.0.10:32:12
at HTMLDocument.listener (drupal.init.js?v=10.0.10:20:7)
Proposed resolution
$(once('hubspot_integration', 'html', context)).each(function () {
//.......
}| Comment | File | Size | Author |
|---|---|---|---|
| #5 | jquery_once_error-3388515.patch | 851 bytes | sarwan_verma |
| #3 | 3388515-1.diff | 694 bytes | rishabjasrotia |
Issue fork hubspot_integration-3388515
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 #3
rishabjasrotia commentedComment #4
rishabjasrotia commentedComment #5
sarwan_verma commentedHi,
I have fixed this issue Drupal 10 Jquery Once Error and also attached patch.
Comment #8
romainj commented