Dialog.ajax recursively overwrites the dialog.close function

Created on 17 September 2018, over 6 years ago
Updated 16 October 2023, about 1 year ago

Problem/Motivation

Each time Drupal.behaviors.dialog.attach() is called it creates a new function which calls the previous settings.dialog.close function resulting in a never ending chain of functions calling each other. The first time the attach behavior is called it creates a copy of the original close function found in dialog.js (this is the intended behavior), but then each subsequent attach behavior creates a copy of the function created from the last time the Drupal.behaviors.dialog.attach() function was called.

Proposed resolution

Only overwrite the settings.dialog.close function once.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Ajax 

Last updated 2 days ago

Created by

🇺🇸United States daniel korte Brooklyn, NY

Live updates comments and jobs are added and updated live.
  • JavaScript

    Affects the content, performance, or handling of Javascript.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024