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
OpenOffCanvasDialogCommand::__construct() is documented as saying "Drupal provides a built-in offcanvas tray for this purpose, so no selector needs to be provided.", but it then proceeds to pass one (#drupal-offcanvas
) to the parent constructor. Meanwhile, this is an ID that doesn't match any element. And the JS code in Drupal.AjaxCommands.prototype.openOffCanvas
doesn't use the returned selector anyway. This is all confusing.
Proposed resolution
- Pass NULL to the parent constructor instead.
- Consider also simplifying OpenOffCanvasDialogCommand::render() to invoke the parent method and only change what needs changing.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#4 | 2785133-4.patch | 1.46 KB | tedbow |
Comments
Comment #2
tedbowComment #3
tedbowComment #4
tedbowI have update the comment. Since we are using the dialog system now we need the hard-coded selector as OpenModalDialogCommand does.
Yes it was probably not using but now the dialog system is. In dialog.ajax.js
This patch does that.
Comment #5
martin107 CreditAttribution: martin107 as a volunteer commentedThis is clearly the correct thing to do --- nice cleanup!
Comment #6
alexpottCommitted and pushed c225f3b to 8.3.x and 2c81806 to 8.2.x. Thanks!
Settings tray is an experimental module so this goes in 8.2.x too.
Comment #9
tedbow@alexpott thanks!
Comment #11
tedbowChanging to new settings_tray.module component. @drpal thanks for script help! :)