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
- Turn on off_canvas_test module
- goto /off-canvas-test-links
- click "Click Me 2!"
- Try opens with width 555
- Without closing tray click "Click me 1!"
- Tray stays at width 555 instead of using default
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#28 | 2828912-28.patch | 3.49 KB | rajeevk |
#23 | 2828912-23.patch | 3.48 KB | rajeevk |
#21 | 2828912-21.patch | 3.56 KB | rajeevk |
#20 | 2828912-20.patch | 2.4 KB | rajeevk |
#16 | 2828912-16.patch | 3.45 KB | tedbow |
Comments
Comment #2
tedbowHere is failing test that proves the problem.
Comment #3
tedbowComment #5
tedbowOk here is fix.
The only way could figure out to do it is explicitly set the width if none is provided. I did this on the php side but could have done it on Javascript.
The problem I see is that now this would always override css but I guess that is fine.
I think the problem is that if you open the tray and then click another link that will be in the tray it is not recreated.
I tried both dialog:beforeclose and dialog:aftercreate js dialog events but no luck.
Comment #10
tedbowForgot to update 2 tests with the new Width option that will come back.
Comment #12
tedbowmarking as child of #2784443: Move off-canvas functionality from Settings tray module into drupal.dialog.ajax library so that other modules can use it because it relates to the offcanvas tray.
Comment #13
tim.plunkettNeeds a comment
Is it ever reasonable to set this to 0? If so, switch to !isset. And either way, probably worth a comment here.
static::
Idk who used self::assertTrue but that should have been $this->assertTrue() to be the same as core, or at the least static::assertTrue()...
Comment #14
tedbow@tim.plunkett thanks review. Fixed all 4 points
I guess this is just 1 of those things that is unknowable, Alas no need to check the previous patch, we will never know.
Comment #15
tim.plunkettEr, I meant !isset. Hopefully that patch fails, or we need more coverage.
Comment #16
tedbow@tim.plunkett yep, I should have run the test locally.
Fixed
Comment #19
tedbowNeeds reroll because of #2862625: Rename offcanvas to two words in code and comments. and other recent commits
Comment #20
rajeevkRe-rolling patch.
Followed reroll documentation & resolved conflict in file
core/module/outside_in/test/src/FunctionalJavascript/OffCanvasTest.php
at Step 9.Comment #21
rajeevkWrong patch...sorry. Missed something in previous one.
Attaching correct one & queuing for test.
Comment #22
tedbow@RajeevK thanks for the reroll!!
Everything looks good expect this 1 minor thing.
.ui-dialog-offcanvas
should be changed to .ui-dialog-off-canvas
This because of class name change in #2862625: Rename offcanvas to two words in code and comments. which was committed since the patch I did in #16
Comment #23
rajeevk@tedbow - Changes done as per your comment. Attaching patch for review & queuing it for test..
Comment #24
tedbow@RajeevK thanks, reroll looks good!
Leaving as needs review for changes introduced in #16(rerolled in #23)
Comment #25
tedbowComment #26
a-fro CreditAttribution: a-fro commented@tedbow I confirmed that the patch applies and works as expected. However, I'd recommend changing the constant name from DIALOG_WIDTH to DEFAULT_DIALOG_WIDTH to make the intention clearer.
Comment #27
rajeevk@tedbow - Let me know if another patch is needed here as per suggestion in #26.
Comment #28
rajeevkAttaching another patch with changed constant name to DEFAULT_DIALOG_WIDTH from DIALOG_WIDTH after confirmation from @tedbow.
Comment #29
tedbow@a-fro thanks the suggestion I think this a good idea.
@RajeevK thanks for the patch the changes look good.
I think this is ready for RTBC but since I wrote the original patch probably someone else should do it if they agree.
Comment #30
a-fro CreditAttribution: a-fro commentedForgot to mention in #26 that I also confirmed that all of the issues from the code review in #13 have been addressed.
Comment #33
lauriiiThe bug fix looks goods. Committed 359663b and pushed to 8.4.x. Thanks!
Since this only affects an experimental module, I think this could be backported to 8.3.x.
Comment #34
xjmYep, as an experimental module change, this is backportable to 8.3.x. It changes only code within the module.
Comment #36
lauriiiCherry picked 3cd15f0 and pushed to 8.3.x. Thanks!
Comment #38
tedbowChanging to new settings_tray.module component. @drpal thanks for script help! :)