Missing dependency on once and js-cookie

Created on 24 May 2023, about 1 year ago
Updated 21 July 2023, 11 months ago

Problem/Motivation

I noticed when using an online demo the following error in the console:

Uncaught TypeError: $(...).once is not a function
attach https://sandbox-carnation-ext-dev-php8.y.org/sites/default/files/js/js_oeUF0vWuqZ1LhDRxPDitaO-QXO2Ri7Y5UaHw9h-QGbM.js:12113
    attachBehaviors https://sandbox-carnation-ext-dev-php8.y.org/sites/default/files/js/js_oeUF0vWuqZ1LhDRxPDitaO-QXO2Ri7Y5UaHw9h-QGbM.js:206
    attachBehaviors https://sandbox-carnation-ext-dev-php8.y.org/sites/default/files/js/js_oeUF0vWuqZ1LhDRxPDitaO-QXO2Ri7Y5UaHw9h-QGbM.js:202
    <anonymous> https://sandbox-carnation-ext-dev-php8.y.org/sites/default/files/js/js_oeUF0vWuqZ1LhDRxPDitaO-QXO2Ri7Y5UaHw9h-QGbM.js:728
    listener https://sandbox-carnation-ext-dev-php8.y.org/sites/default/files/js/js_oeUF0vWuqZ1LhDRxPDitaO-QXO2Ri7Y5UaHw9h-QGbM.js:716
    domReady https://sandbox-carnation-ext-dev-php8.y.org/sites/default/files/js/js_oeUF0vWuqZ1LhDRxPDitaO-QXO2Ri7Y5UaHw9h-QGbM.js:722
    <anonymous> https://sandbox-carnation-ext-dev-php8.y.org/sites/default/files/js/js_oeUF0vWuqZ1LhDRxPDitaO-QXO2Ri7Y5UaHw9h-QGbM.js:727
    <anonymous> https://sandbox-carnation-ext-dev-php8.y.org/sites/default/files/js/js_oeUF0vWuqZ1LhDRxPDitaO-QXO2Ri7Y5UaHw9h-QGbM.js:730

There's also another error with js-cookie missing on Drupal 10.1
Reference: https://www.drupal.org/node/3104677 β†’

Steps to reproduce

Proposed resolution

  1. Update the JS not to use jquery.once (it's gone in D10 IIRC) but rather core.once.
  2. Add core.once as a dependency.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom AndyF

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

Comments & Activities

Production build 0.69.0 2024