Fix Uncaught TypeError: $(...).once is not a function

Created on 26 July 2023, over 1 year ago
Updated 16 October 2023, about 1 year ago

Problem/Motivation

After upgrading the module to version 4.1.6 and start using it on Drupal 10, I've noticed some errors on the JS console specially the

Uncaught TypeError: $(...).once is not a function

This was happening on the following files:

  • modules/simple_sitemap_views/js/simple_sitemap.viewsUi.js
  • js/simple_sitemap.sitemapEntities.js

Steps to reproduce

  1. Enable the module on a drupal 10 instance
  2. Enable the simple_sitemap_views module on a drupal 10 instance
  3. Open the page admin/config/search/simplesitemap/entities
  4. Check your browser console
  5. Create a page view and mark it to index on sitemap
  6. Check your browser console

Proposed resolution

Remove the old jquery once from the files and replace it by the new core/once package.

Remaining tasks

  1. Review
  2. Commit
🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇧🇷Brazil murilohp

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

Comments & Activities

Production build 0.71.5 2024