once is not a function (identical to 3277218)

Created on 1 February 2023, about 2 years ago
Updated 20 November 2023, over 1 year ago

1.0 Problem/Motivation
On version 6.2.2, while rendering the webform, I get, on console, the error twice: Uncaught ReferenceError: once is not defined but for difference js files.

2.0 Detailed steps to reproduce (embed screenshots)

  • Added core contact fields
  • Added custom fields
  • Added address fields

Screenshot:

I believe this issue is similar to https://www.drupal.org/project/webform_civicrm/issues/3277218 but it doesn't affect the payment module this time

3.0 Proposed resolution
Add the same dependencies (- core/once) inside webform_civicrm.libraries.yml for:

  • js/webform_civicrm_forms.js
  • js/webform_civicrm_contact.js

like so:

civicrm_contact:
  css:
    component:
      css/token-input.css: {}
  js:
    js/jquery.tokeninput.js: {}
    js/webform_civicrm_contact.js: {}
  dependencies:
    - core/once <---
    - webform_civicrm/forms

and similarly, add the same core/once dependency on forms.

Cheers

🐛 Bug report
Status

Closed: cannot reproduce

Version

6.2

Component

Webform/Drupal

Created by

🇬🇧United Kingdom vangelisp Fife, Scotland

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

Comments & Activities

Production build 0.71.5 2024