Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When using the Bootstrap theme with the entity browser module, I realized, that the modal JavaScripts have some problems:
dialog:beforeclose
anddialog:afterclose
events are only fired, when the modal is closed viacloseDialog()
function- Current
dialog.js
anddialog.ajax.js
differ from core's ones
Proposed resolution
- Rework dialog JS scripts to be up to date with core's ones
- Ensure all events are fired correctly (e.g. by leveraging/binding Bootstraps
*.bs.modal
events to trigger appropriate events required for Drupal
Remaining tasks
- Rework JS files to be up to date with core
- Ensure triggering of appropriate events
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#4 | bootstrap-fix-core-dialog-events-2826277-4-D8.patch | 1.37 KB | stan.ag |
#3 | bootstrap-fix-core-dialog-events-2826277-3-D8.patch | 1.45 KB | stan.ag |
Comments
Comment #2
stan.ag CreditAttribution: stan.ag as a volunteer commentedI confirm that this issue is still actual after 8.x-3.1 release. Changing category to "Bug report" as it actually breaks functionality in some cases ('Entity browser' module being an example, as it relies on 'dialog:beforeclose' event which is not fired if dialog is closed manually).
Comment #3
stan.ag CreditAttribution: stan.ag as a volunteer commentedA quick patch to fix core dialog events.
Comment #4
stan.ag CreditAttribution: stan.ag as a volunteer commentedIn previous patch, 'show.bs.modal.drupal' and 'hidden.bs.modal.drupal' events weren't fired. I removed the first event (thus restored original code) and changed dialog.ajax.js in order to fire the last one.
Comment #5
gge CreditAttribution: gge commentedFile Entity Browser doesn't work Bootstrap 8.x-3.x-dev (22 Mar 2017) patched width #4. Thanks
Comment #6
maxplus CreditAttribution: maxplus commentedHaving the same issue as #5, entity browser modal not closing after submit in current 8.x-3.3
Comment #7
markhalliwell