Closed (fixed)
Project:
Drupal core
Version:
8.6.x-dev
Component:
layout_builder.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Oct 2017 at 17:49 UTC
Updated:
17 Feb 2018 at 05:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tim.plunkettComment #3
larowlanComment #4
xjmThis might be critical if LB were stable, so promoting to major.
Comment #5
tim.plunkettComment #7
xjmThis is a bug, and would indeed be critical. We have precedent for that for the views/config issue... except this is even worse because that at least had a confirmation form that was hard to read (whereas this one makes a stray mouse click destroy tons of work.)
As a data loss issue, we would make it critical even while LB is in beta. It can remain major while LB is in alpha.
Edit: I mistakenly thought this was the issue for a different problem, wherein the "Revert to defaults" link deletes your layout override with no warning/confirmation/clicking save. Per @tim.plunkett it's a separate issue though, so moving that back to the other issue (there's already a fix for it there now).
I'll test this one and confirm whether it also needs some removal/fix/prevention before beta.
Comment #8
tim.plunkettThis is blocked on #2922033: Use the Layout Builder for EntityViewDisplays
Interdiff against that issue.
Comment #10
tim.plunkettComment #11
tim.plunkettRerolled now that #2922033: Use the Layout Builder for EntityViewDisplays is in
Comment #12
tim.plunkettThis form should be on an admin route.
Here are some screenshots:
Comment #13
xjmComment #14
tim.plunkett#13
1) Fixed
2) I went with the improved message but without a count
3) The button isn't necessarily as harmless as that. I started looking into the code for such a query, until I remembered that we'd also be kicking people out mid-tempstore. If we went "oh there are 0 overrides on disk, let's skip the form" but someone was mid-flow, they'd be just as screwed as if they'd saved it.
So, keeping the existing logic and warning always.
4) This is tricky. At least in the case of the "Default" view mode, there are other form elements on the page that are indeed saved!
For example, the other fieldset "CUSTOM DISPLAY SETTINGS".
*Those* values are indeed saved...
Not sure what to do about that.
From what I can see, we have 3 options:
Leave the message as is
Move this checkbox somewhere else (where?)
Somehow magically defer the saving of the rest of the form until after this other confirm (is that possible? what if they hit cancel, do we discard their other changes?)
Comment #15
tim.plunkettI think that #13.4 could lead to some iterations with the UX team, and I think that could be done after beta, so I opened #2941189: Confirmation form for disabling per-entity layout overrides shows a success message and should not.
Comment #16
xjmHmm, #4 seems problematic. I would definitely not expect that other values on the page had been saved if I went to a confirmation form and then hit cancel. I'm reluctant to defer that to a followup since it would be a major bug IMO. Tagging for usability review to see if we can get some suggestions.
For #3, how about we tell the user explicitly about currently edited things? E.g.:
Or if there are none, just:
Comment #17
tim.plunkettThere is currently no mechanism for determining the overrides that correspond to a given default.
The entire system is written the other direction (an override can retrieve it's corresponding default)
Comment #18
tim.plunkettIf we want to add such a mechanism, that would block this issue on #2937483: Defining a new type of section storage relies on magic strings and hidden assumptions (also a beta blocker).
Comment #19
tim.plunkettHere's an alternate solution proposed by @xjm:
Disable the checkbox when overrides exist.
And then find a more elegant solution in the follow-up.
No interdiff as this is a completely new approach.
Comment #20
tim.plunkettTagging the follow up for UX review.
Comment #21
eclipsegc commentedOk, so this new version of the patch sidesteps the whole confirmation issue by simply preventing the unclicking of the form element when overrides exist. As solutions go, this seems like a pretty straight-forward one and I think covers the data loss concern sufficiently. Assuming this passes tests I'm totally on board and saw nothing in the patch that concerned me. Anyone else have push-back on this approach?
Eclipse
Comment #22
xjm+1 for this approach as an intermediate step.
Should we also add a test that the checkbox is again uncheckable when you revert an overridden layout to the default?
Comment #23
xjmI manually tested a few different scenarios and it seems to work fine; no weird/confusing things.
Comment #24
tim.plunkettGood idea! Added.
Comment #25
eclipsegc commentedLooks good to me!
Eclipse
Comment #26
larowlanManually tested, screenshots attached, works like it says on the box
Comment #28
larowlanCommitted 9d81d2c and pushed to 8.6.x
One more down
Comment #30
xjmOK this will work better if I actually post using my account. Retroactively adding credit for Kris and Sam who helped decide the approach with us in Slack. :)
Comment #31
eclipsegc commentedthanks! :-D
Comment #33
tim.plunkett