core/drupal.dialog.ajax needlessly attached for links that open dialogs

Created on 14 January 2025, 3 months ago

Problem/Motivation

Various places in core that render links which open dialogs attach the core/drupal.dialog.ajax library. As far as I can tell this is unnecessary. The use-ajax class of the link already intercepts the regular link functionality and the dialog library will already be attached by the Ajax response of the link request. So there is no reason to attach it, as far as I can tell.

Steps to reproduce

-

Proposed resolution

Remove the attaching of the library from various places where it's not needed. This not only saves some needless bytes over the wire and also removes some boilerplate which I think people often copy-paste (at least I do 😉).

Remaining tasks

User interface changes

-

Introduced terminology

-

API changes

-

Data model changes

-

Release notes snippet

-

📌 Task
Status

Active

Version

11.0 🔥

Component

ajax system

Created by

🇩🇪Germany tstoeckler Essen, Germany

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

Merge Requests

Comments & Activities

  • Issue created by @tstoeckler
  • 🇩🇪Germany tstoeckler Essen, Germany

    Checked at least that the views operations still work (and the unit test passes), let's see if anything else breaks.

  • Pipeline finished with Failed
    3 months ago
    Total: 577s
    #395694
  • 🇩🇪Germany tstoeckler Essen, Germany

    Hmm... I can reproduce the test failures in core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5DialogTest.php and core/modules/field_ui/tests/src/FunctionalJavascript/DisplayModeBundleSelectionTest.php, but I cannot reproduce it outside of a test. I even tried in Stark and the dialog appears perfectly with this branch. Not sure what's going on, maybe someone else can investigate, not sure I will get to it.

Production build 0.71.5 2024