jQuery once deprecated in drupal 10 - previewer js not working

Created on 12 December 2023, about 1 year ago
Updated 23 January 2024, 11 months ago

Problem/Motivation

After upgrading drupal Core version to 10 jQuery once is no longer supported.

For this module, this means that the js file needs to be updated. The file is 'previewerRefresh.behavior.js' and the error that appears in the console is that .each() is not a function.
The error points to line 12 of the file mentioned, it happens here ' once('previewerRefresh', '.js-previewerRefresh', context).each( ' .

Futhermore, the module js file that is passed to the website in the libraries.yml is created by running a 'build' script ( dist/js/previewerRefresh.behavior.js: { minified: true } ) .

My question is how can we updated the module making it compatible with drupal 10 ?

Should we create a patch for the module? How should we do it? I have tried creating a patch that changes 'previewerRefresh.behavior.js' but this isnยดt the file that is provided to the website so it doesnยดt change anything.

Steps to reproduce

Using previewer with drupal 10

Proposed resolution

Don't know yet.

Remaining tasks

Fixing the js problems.

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ต๐Ÿ‡นPortugal JoaoCoelho13

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

Comments & Activities

Production build 0.71.5 2024