Problem/Motivation
Let's say you've reordered the blocks for the article content type in Layout Builder from the default:
- Image
- Body
- Tags
- Links
- Comments
to
- Tags
- Body
- Image
- Links
- Comments
You click now the Discard changes
button. Let's say you have a small working memory, you then get distracted and pull away from the computer and you cant remember what the changes were you've made when you return. Now you want to discard those changes. On the confirmation page for discarding the changes you have two buttons as options: Confirm
and Cancel
.
Clicking the confirm button brings you back to the Manage display
page and an info admin message informs you that the changes to the layout have been discarded. You are back to the default order of blocks.
If you click the Cancel
button instead the outcome is different and sort of unexpected. Technically to cancel something means to stop the started task and go back to the starting point/revert a step. But instead you are also getting forwarded back to the Manage display
page, but in contrast clicking the confirm
button, you don't have any info admin message but the changes to the layout get saved anyway.
Steps to reproduce
- Go to
/admin/structure/types/manage/article/display/default
- Activate Layout Builder
- Change the order of the default blocks to Tags, Body, Image, Links, Comments
- Click the
Discard changes
button - Click confirm
- Reapply the changes to the block order for the layout
- Click the
Discard changes
button again - Click the
Cancel
button
Proposed resolution
i would lean towards the following when the Cancel
button is pressed/clicked. Instead of saving the layout and forwarding back to the Manage display
page redirect back to the page of the layout so the user is able to continue with the already made changes.