Problem/Motivation
Settings Tray uses the form handler key, 'off_canvas', for a block entity form handler. This ties Settings Tray functionality to a particular dialog type. Although Settings Tray uses the off-canvas
dialog the need for the different form handler is the Settings Tray functionality of simplifying the Block entity edit from and bringing in related configuration.
It is totally possible the that another module in core or contrib would want to open up another version of the Block entity form in the off-canvas dialog, for instance as a quick way adjust visibility settings.
Proposed resolution
- Change the form handler key from
off_canvas
tosettings_tray
- Change the route name from
entity.block.off_canvas_form
toentity.block.settings_tray_form
- Change the path to the form from
/admin/structure/block/manage/{block}/off-canvas
to/admin/structure/block/manage/{block}/settings-tray
- change the block entity link template from
off_canvas-form
tosettings_tray-form
Remaining tasks
The patch
User interface changes
None
API changes
Internal only
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#40 | 2905098-40.patch | 9.7 KB | jofitz |
#33 | 2905098-33.patch | 9.79 KB | tedbow |
Comments
Comment #2
tedbowComment #3
tedbowComment #4
tedbowChanging to new settings_tray.module component. @drpal thanks for script help! :)
Comment #5
tedbowNeeds reroll at least for changes in #2803375: Rename Outside-in module to "Settings Tray" for real
Comment #6
jofitz CreditAttribution: jofitz at ComputerMinds commentedRe-rolled.
Comment #7
tedbow@Jo Fitzgerald thanks the re-roll looks good!
So this patch is pretty simple so I think just a review to get it to RTBC.
Comment #8
Wim LeersI first thought this was a BC break, but it isn't, this is an implementation detail. Great, this is then finally completely consistent! :)
Comment #10
Wim LeersComment #11
yogeshmpawarRerolled the patch #6 because it's failed to apply on 8.5.x branch.
Comment #12
yogeshmpawarComment #13
Wim LeersThanks, @Yogesh Pawar! I manually verified that #6 and #10 are equivalent.
Comment #14
xjmOops, this should have gone in before beta. Since it's in beta now and the route and link template are things contrib might interact with, I don't think we should backport it to 8.4.x.
Patch looks good. Can we also get a small change record for the same reason? Since these are things a contrib/custom module would conceivably interact with.
Comment #15
tedbowAdd change record for form and link template keys? https://www.drupal.org/node/2929216
Since this route is to an @internal form do we need a change record for this?
Comment #16
tedbowComment #18
tedbowDrupalCI Memory problem
Comment #19
larowlanDo we have to remove these keys? Can we retain both sets. I'm concerned removing them after this has been in the wild for most of the 8.4 cycle will be disruptive
We can retain the existing class, mark it deprecated and use trigger_error
Then we can communicate that it will be removed in the future.
Comment #20
larowlanComment #22
tedbowRe #19 we could keep both the keys but I think we shouldn't because:
I think this is very unlikely but also if they altered it would most likely be with the intention of having Settings Tray use this form in the off-canvas dialog. So then we would get into situation of having to check if `off_canvas` key still after this change and if it was altered from `BlockEntityOffCanvasForm::class` then to use the new class instead. But then what if 1 module alters the deprecated `off_canvas` key and another modules alters the current `settings_tray` key? When would probably want to pick the current `settings_tray` key to respect but then what is the point of leaving `off_canvas` key as deprecated if we aren't going to respect it all the time.
My vote would be just rip the band-aid off and just switch to the new key.
Comment #23
tedbowThe patch also need a re-roll
Comment #24
larowlanI'm more concerned about the link template than the form class
The reason to leave them is if someone else is displaying the form, or using the link template, it will stop working.
E.g.
This would hard break that, which is something we shouldn't do for a beta module.
Added #2928750: Allow to deprecate routes as related for our eventual exit strategy.
So I think we need to, rename the class but keep the old one (subclass as an empty shell), mark it as deprecated and add a trigger_error.
And keep both old keys.
Then wait on #2928750: Allow to deprecate routes to deprecate the route name.
What do you think @xjm
Comment #25
Wim LeersI agree with @larowlan — this is why I RTBC'd it in #8, in September, before 8.4.0 was released, i.e. when Settings Tray was still alpha.
Now that it's beta, we have to retain BC.
For deprecating routes, I think the issue that spawned [#29289750] settled on a nice solution, based on discussion between @dawehner and I. That issue is #2858482: Simplify REST routing: disallow requesting POST/PATCH in any format, make consistent. What it does is:
@trigger_error(…, E_USER_DEPRECATED)
This strategy reduces future maintenance burden, maximally signals that the old thing shouldn't be used anymore, yet keeps BC.
Comment #26
Wim LeersAlright, @tedbow has a day off today, so I'll implement what I proposed in #25 so he only needs to review and hopefully is comfortable RTBC'ing the route deprecation logic that I'll propose.
Comment #27
Wim LeersDone. Includes test coverage proving that the old route name still generates a URL, that that URL matches the updated URL, and that an appropriate
E_USER_DEPRECATED
error is triggered.Comment #28
tedbowI was confused in #22 because I thought the proposal to was to also keep the form handler key.
Keeping the route key as deprecated seems like a good idea since the module already experimental beta.
The outbound route processor and the test coverage looks good.
Thanks @larowlan and @Wim Leers!
Comment #31
rajeshwari10 CreditAttribution: rajeshwari10 as a volunteer and at Valuebound commentedHi,
Applied the patch in #27 against Drupal core 8.6.x branch but it failed to apply. So created the patch with the changes against Drupal core 6.x branch. Please Review.
Comment #33
tedbow@rajeshwari10 thanks for the patch but it included unrelated changes.
When I am doing a reroll usually I check to make sure the patch file is about the same size the previous patch and then that it only modified the same files.
#31 is much bigger patch than #27
Comment #34
tedbowNo changes just a reroll
Comment #36
MerryHamster CreditAttribution: MerryHamster at Skilld commentedChanged `\Drupal::url` to `Url::fromRoute` in hook_help.
Added changes for applying the patch.
Comment #37
MerryHamster CreditAttribution: MerryHamster at Skilld commentedComment #39
tedbow@MerryHamster(BTW love username ;) ) thanks for the rerolled patch.
Thanks for catching this but we have to keep this issue scope limited.
Take a look at https://www.drupal.org/core/scope#definition
But generally
We should be able to get git to recognize this as rename instead of delete and then new file.
This will greatly reduce the size of the patch which will help reviewers because they won't to check to sure the new and old files are actually the same.
To do this you can do something like
git diff -M25% 8.6.x > ../mypatchfile.patch
This file is just left over from the `patch` command probably.
Comment #40
jofitz CreditAttribution: jofitz at ComputerMinds commentedRe-roll.
Comment #41
tedbow@Jo Fitzgerald looks good thanks
Comment #42
webchickLooks great from a consistency POV, and has a BC layer in case someone for some random reason was relying on these old names.
Committed and pushed to 8.6.x; cherry-picked to 8.5.x. Thanks!
Comment #46
quietone CreditAttribution: quietone at PreviousNext commentedpublish the change record