[D10] Replace jquery.once with new once API

Created on 16 May 2023, over 2 years ago

Problem/Motivation

https://www.drupal.org/node/3158256 β†’

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium p-neyens

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

Merge Requests

Comments & Activities

  • Issue created by @p-neyens
  • Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 8
    last update over 2 years ago
    Waiting for branch to pass
  • Issue was unassigned.
  • Status changed to Needs review over 2 years ago
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa

    This change isn't working for me, it is just reverting the out-of-the-box phone validation, unless I am missing something here:

  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa

    There's a bunch of errors related to the old jQuery once not supported anymore, I'll address these here:

    Uncaught TypeError: $(...).find(...).once is not a function
        at Object.attach (webform.element.telephone.js?sznlzb:26:10)
        at drupal.js?v=11.1.5:166:24
        at Array.forEach (<anonymous>)
        at Drupal.attachBehaviors (drupal.js?v=11.1.5:162:34)
        at HTMLUListElement.<anonymous> (ajax.js?v=11.1.5:1402:18)
        at jQuery.each (jquery.js:383:19)
        at jQuery.each (jquery.js:205:17)
        at Drupal.AjaxCommands.insert (ajax.js?v=11.1.5:1394:19)
        at ajax.js?v=11.1.5:1046:41Understand this error
    drupal.js?v=11.1.5:64 Uncaught TypeError: $(...).find(...).once is not a function
        at Object.attach (webform.element.telephone.js?sznlzb:26:10)
        at drupal.js?v=11.1.5:166:24
        at Array.forEach (<anonymous>)
        at Drupal.attachBehaviors (drupal.js?v=11.1.5:162:34)
        at HTMLAnchorElement.<anonymous> (ajax.js?v=11.1.5:1402:18)
        at jQuery.each (jquery.js:383:19)
        at jQuery.each (jquery.js:205:17)
        at Drupal.AjaxCommands.insert (ajax.js?v=11.1.5:1394:19)
        at ajax.js?v=11.1.5:1046:41Understand this error
    drupal.js?v=11.1.5:64 Uncaught TypeError: $(...).find(...).once is not a function
        at Object.attach (webform.element.telephone.js?sznlzb:26:10)
        at drupal.js?v=11.1.5:166:24
        at Array.forEach (<anonymous>)
        at Drupal.attachBehaviors (drupal.js?v=11.1.5:162:34)
        at HTMLUListElement.<anonymous> (ajax.js?v=11.1.5:1402:18)
        at jQuery.each (jquery.js:383:19)
        at jQuery.each (jquery.js:205:17)
        at Drupal.AjaxCommands.insert (ajax.js?v=11.1.5:1394:19)
        at ajax.js?v=11.1.5:1046:41Understand this error
    drupal.js?v=11.1.5:64 Uncaught TypeError: $(...).find(...).once is not a function
        at Object.attach (webform.element.telephone.js?sznlzb:26:10)
        at drupal.js?v=11.1.5:166:24
        at Array.forEach (<anonymous>)
        at Drupal.attachBehaviors (drupal.js?v=11.1.5:162:34)
        at HTMLUListElement.<anonymous> (ajax.js?v=11.1.5:1402:18)
        at jQuery.each (jquery.js:383:19)
        at jQuery.each (jquery.js:205:17)
        at Drupal.AjaxCommands.insert (ajax.js?v=11.1.5:1394:19)
        at ajax.js?v=11.1.5:1046:41Understand this error
    drupal.js?v=11.1.5:64 Uncaught TypeError: $(...).find(...).once is not a function
        at Object.attach (webform.element.telephone.js?sznlzb:26:10)
        at drupal.js?v=11.1.5:166:24
        at Array.forEach (<anonymous>)
        at Drupal.attachBehaviors (drupal.js?v=11.1.5:162:34)
        at HTMLAnchorElement.<anonymous> (ajax.js?v=11.1.5:1402:18)
        at jQuery.each (jquery.js:383:19)
        at jQuery.each (jquery.js:205:17)
        at Drupal.AjaxCommands.insert (ajax.js?v=11.1.5:1394:19)
        at ajax.js?v=11.1.5:1046:41Understand this error
    drupal.js?v=11.1.5:64 Uncaught TypeError: this.$el.children(...).drupalToolbarMenuHorizontal is not a function
        at r.renderHorizontal (MenuVisualView.js?v=11.1.5:37:46)
        at r.render (MenuVisualView.js?v=11.1.5:28:14)
        at r.initialize (MenuVisualView.js?v=11.1.5:20:14)
        at h.View (backbone.js:1340:21)
        at new r (backbone.js:2112:41)
        at toolbar.js?v=11.1.5:137:47
        at Array.forEach (<anonymous>)
        at Object.attach (toolbar.js?v=11.1.5:80:59)
        at drupal.js?v=11.1.5:166:24
        at Array.forEach (<anonymous>)Understand this error
    drupal.js?v=11.1.5:64 Uncaught TypeError: $(...).find(...).once is not a function
        at Object.attach (webform.element.telephone.js?sznlzb:26:10)
        at drupal.js?v=11.1.5:166:24
        at Array.forEach (<anonymous>)
        at Drupal.attachBehaviors (drupal.js?v=11.1.5:162:34)
        at drupal.init.js?v=11.1.5:32:12
        at HTMLDocument.listener (drupal.init.js?v=11.1.5:20:7)Understand this error
    drupal.js?v=11.1.5:64 Uncaught TypeError: $(...).find(...).once is not a function
        at Object.attach (webform.element.telephone.js?sznlzb:26:10)
        at drupal.js?v=11.1.5:166:24
        at Array.forEach (<anonymous>)
        at Drupal.attachBehaviors (drupal.js?v=11.1.5:162:34)
        at HTMLAnchorElement.<anonymous> (ajax.js?v=11.1.5:1402:18)
        at jQuery.each (jquery.js:383:19)
        at jQuery.each (jquery.js:205:17)
        at Drupal.AjaxCommands.insert (ajax.js?v=11.1.5:1394:19)
        at ajax.js?v=11.1.5:1046:41Understand this error
    drupal.js?v=11.1.5:64 Uncaught TypeError: $(...).find(...).once is not a function
        at Object.attach (webform.element.telephone.js?sznlzb:26:10)
        at drupal.js?v=11.1.5:166:24
        at Array.forEach (<anonymous>)
        at Drupal.attachBehaviors (drupal.js?v=11.1.5:162:34)
        at success (ajax.js?v=11.1.5:1833:20)
        at l (loadjs.min.js?v=4.3.0:1:217)
        at loadjs.min.js?v=4.3.0:1:1712
        at Array.n (loadjs.min.js?v=4.3.0:1:1639)
        at u (loadjs.min.js?v=4.3.0:1:117)
        at loadjs.min.js?v=4.3.0:1:1443Understand this error
    drupal.js?v=11.1.5:64 Uncaught TypeError: $(...).find(...).once is not a function
        at Object.attach (webform.element.telephone.js?sznlzb:26:10)
        at drupal.js?v=11.1.5:166:24
        at Array.forEach (<anonymous>)
        at Drupal.attachBehaviors (drupal.js?v=11.1.5:162:34)
        at HTMLDivElement.<anonymous> (ajax.js?v=11.1.5:1402:18)
        at jQuery.each (jquery.js:383:19)
        at jQuery.each (jquery.js:205:17)
        at Drupal.AjaxCommands.insert (ajax.js?v=11.1.5:1394:19)
        at ajax.js?v=11.1.5:1046:41
    
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa

    It seems to work now:

    I don't think it needs further testing now, I'll merge it to the 1.0.x branch.

  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • πŸ‡ΊπŸ‡ΈUnited States luke.leber Pennsylvania
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • πŸ‡¨πŸ‡¦Canada danrod Ottawa
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024