Replace deprecated core/jquery.once for Drupal 10 support

Created on 4 October 2023, about 1 year ago
Updated 9 October 2023, about 1 year ago

Problem/Motivation

I think this is important to fix before the new beta is released with Drupal 10 support.

In the latest dev version of Private Message the Upgrade status report still gives 6 problems found.

web/modules/contrib/private_message/private_message.libraries.yml:
┌──────────┬──────┬──────────────────────────────────────────────────────────────┐
│  STATUS  │ LINE │                           MESSAGE                            │
├──────────┼──────┼──────────────────────────────────────────────────────────────┤
│ Handmati │ 0    │ The 'inbox_block_script' library is depending on a           │
│ g        │      │ deprecated library. The core/jquery.once asset library is    │
│ controle │      │ deprecated in Drupal 9.3.0 and will be removed in Drupal     │
│ ren      │      │ 10.0.0. Use the core/once library instead. See               │
│          │      │ https://www.drupal.org/node/3158256                          │
│          │      │                                                              │
│ Handmati │ 0    │ The 'notification_block_script' library is depending on a    │
│ g        │      │ deprecated library. The core/jquery.once asset library is    │
│ controle │      │ deprecated in Drupal 9.3.0 and will be removed in Drupal     │
│ ren      │      │ 10.0.0. Use the core/once library instead. See               │
│          │      │ https://www.drupal.org/node/3158256                          │
│          │      │                                                              │
│ Handmati │ 0    │ The 'private_message_thread_script' library is depending on  │
│ g        │      │ a deprecated library. The core/jquery.once asset library is  │
│ controle │      │ deprecated in Drupal 9.3.0 and will be removed in Drupal     │
│ ren      │      │ 10.0.0. Use the core/once library instead. See               │
│          │      │ https://www.drupal.org/node/3158256                          │
│          │      │                                                              │
│ Handmati │ 0    │ The 'members_widget_script' library is depending on a        │
│ g        │      │ deprecated library. The core/jquery.once asset library is    │
│ controle │      │ deprecated in Drupal 9.3.0 and will be removed in Drupal     │
│ ren      │      │ 10.0.0. Use the core/once library instead. See               │
│          │      │ https://www.drupal.org/node/3158256                          │
│          │      │                                                              │
│ Handmati │ 0    │ The 'message_form' library is depending on a deprecated      │
│ g        │      │ library. The core/jquery.once asset library is deprecated in │
│ controle │      │ Drupal 9.3.0 and will be removed in Drupal 10.0.0. Use the   │
│ ren      │      │ core/once library instead. See                               │
│          │      │ https://www.drupal.org/node/3158256                          │
│          │      │                                                              │
│ Handmati │ 0    │ The 'uninstall_page' library is depending on a deprecated    │
│ g        │      │ library. The core/jquery.once asset library is deprecated in │
│ controle │      │ Drupal 9.3.0 and will be removed in Drupal 10.0.0. Use the   │
│ ren      │      │ core/once library instead. See                               │
│          │      │ https://www.drupal.org/node/3158256                          │
│          │      │                                                              │
└──────────┴──────┴──────────────────────────────────────────────────────────────┘

Steps to reproduce

Go to the latest dev version Commit 4e0703774c89305165edab9f8ccd84027e9c4b41 and run the Upgrade status.

Proposed resolution

Let's add the core/once library and rewrite the Javascript accordingly. I found a patch in https://www.drupal.org/project/private_message/issues/3297888#comment-15... 📌 Automated Drupal 10 compatibility fixes Needs review which partially solves the problem.

📌 Task
Status

Fixed

Version

3.0

Component

Code

Created by

🇳🇱Netherlands jaapjan

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

Comments & Activities

Production build 0.71.5 2024