A legacy form #ajax method value causes JavaScript error at Fields Settings page on Drupal 11 RC1

Created on 19 July 2024, about 2 months ago
Updated 5 August 2024, about 1 month ago

Problem/Motivation

Error message from browser developer console:

An error occurred during the execution of the Ajax response: TypeError: $wrapper[method] is not a function ajax.js:1143:19
    success http://localhost:8888/core/misc/ajax.js?v=11.0.0-rc1:1143
    (Async: promise callback)
    success http://localhost:8888/core/misc/ajax.js?v=11.0.0-rc1:1141
    success http://localhost:8888/core/misc/ajax.js?v=11.0.0-rc1:584
    jQuery 8
    eventResponse http://localhost:8888/core/misc/ajax.js?v=11.0.0-rc1:796
    Ajax http://localhost:8888/core/misc/ajax.js?v=11.0.0-rc1:646
    jQuery 2

Steps to reproduce

  1. Install Drupal 11.0.0-rc1 with the standard profile.
  2. Enable Diff 2.0.0-beta2 module.
  3. Go to /admin/config/content/diff/fields.
  4. Change any field plugin settings to other value, JavaScript error occurs.

Proposed resolution

Use 'replaceWith' as '#ajax' method value.
Some of form uses '#ajax' which specify 'replace' as method value.
But this value is already labeled as legacy support since Drupal 8, and removed from Drupal 11.
Legacy 'replace' value was automatically replaced with 'replaceWith' internally till the Drupal 10.x branch.

Remaining tasks

User interface changes

No.

API changes

No.

Data model changes

No.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇯🇵Japan Tom Konda

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024