Problem/Motivation
When you submit the block content add form, you're redirected to the add block (place block) form for the newly added block content item.
This made sense in the context of block content only being used with the global page layout, but with the advent of layout builder it no longer makes sense.
Steps to reproduce
Goto block/add
Add a block content item
Note you're redirected to the place block form
Proposed resolution
When on the block content form, when the block content item is being created for the first time, add a secondary action 'Save and configure'. Have this button do the redirect. Have the existing save button redirect back to the block library.
This is similar to the pattern with terms, where we have two save buttons, one that returns to the list, and one that reloads the add form ready to add additional terms
Remaining tasks
Agree, patch, review
User interface changes
New 'Save and place' button.
This uses the existing 'place block' terminology seen in the block layout page
Step 1 go to /block/add

Before you would be redirected to

After change you would be redirected to

API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #37 | active_tab.jpg | 190.17 KB | rkoller |
| #19 | Screen Shot 2023-02-06 at 8.38.31 PM.png | 304.59 KB | smustgrave |
| #19 | Screen Shot 2023-02-06 at 8.38.48 PM.png | 266.01 KB | smustgrave |
| #19 | Screen Shot 2023-02-06 at 8.38.15 PM.png | 237.61 KB | smustgrave |
Issue fork drupal-3325167
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3325167-revisit-the-redirect
changes, plain diff MR !3170
Comments
Comment #2
larowlanComment #3
larowlanComment #4
acbramley commentedTotally agree with this, we alter away this redirect.
Also, when using other contrib modules to provide access to creating block content entities without being able to place those blocks, the redirect can lead to a 403.
I'm curious about the use case for going straight from adding a new Block content entity to placing it in the block layout. In "normal" workflows, this would only happen from a sitebuilder/developer on their local environment as block config should be exported and committed to the codebase. How often are site builders using this workflow?
Comment #5
larowlanThere's still a subset of users who don't track config in version control
Comment #6
benjifisherComment #7
aaronmchaleThis may become even more important with #3318110: [meta] Reorganize Block items in the administration menu, specifically #2862564: Move Custom block library to Content. At least right now in 10.0 everything is under the Block Layout area, but with Block Content moving to Content, there will be a significant separation in the information architecture between Content Blocks and the Block Layout, so we definitely need to do something about this.
Comment #8
aaronmchaleComment #9
aaronmchaleCould we get some screenshots of the current state to better illustrate the problem?
At the usability group we're actively tracking the work around #3318110: [meta] Reorganize Block items in the administration menu so I'd like to bring this issue up at a future meeting as it's very relevant.
Comment #12
smustgrave commentedUploaded some screenshots of what I see.
Also opened an MR with a proposed solution. No tests yet.
Comment #13
xjm@smustgrave When you post screenshots, it is helpful to embed them in the issue summary.
Marking NW and tagging for tests.
Comment #14
xjmAdding the screenshots to the IS.
Comment #15
xjmHm, except the screenshots also are not of the described UI changes. Were the correct files uploaded, or is the IS wrong?
Comment #16
aaronmchaleUsability review
We reviewed this issue at #3336927: Drupal Usability Meeting 2023-02-03, that issue will have a link to the recording.
Those who attended the meeting were: @AaronMcHale, @iszabo, @rkoller, @shaal, and @simohell.
When reviewing this issue we observed how the Taxonomy Term add form currently behaves, how it presents a similar integration pattern. The group was generally in favour of the pattern of more than one "Save" button. The group also observed that when the Term add form has the
destinationparameter in the URL, the additional "Save" button does not display, only the primary "Save" button is shown.Instead of "Save and place", the group recommended the text "Save and configure" for the additional action button. The recommendation is based on the fact that after clicking that button, the user is taken to a form titled "Configure block". It was felt that it could be confusing for users if the described action was not consistent with the title of the form they are taken to. The group felt that because the Configure block form uses the term "Place block" for the primary action button helped to convey would what happen once they clicked that button.
It should be noted that the recommendation is based on keeping consistency in the current UI. In light of the recent moves to restructure the blocks area of the admin UI, it was also noted that we may want to review the title of the "Configure block" form, perhaps titling it something like "Place block" would be more appropriate and help to convey that this form is relating to blocks placed in regions and not general configuration of a block. The lack of clarify here was seen as a cause of confusion, for example the visability options on the "Configure block" form could be misinterpreted to apply to the Custom Block entity itself, rather than the single configuration instance of the block currently being placed.
For the avoidance of doubt, if the title of the "Configure block" form is changed, then in the interest of consistency that should also mean that any action buttons leading to that form should also be updated, such as the one proposed here.
Comment #17
larowlanThanks @AaronMcHale I've updated the issue summary to match that
I think this is now ready for development
Comment #18
smustgrave commentedIf the issue I proposed in the MR sounds good I can get working on tests.
Comment #19
smustgrave commentedComment #20
larowlanI think we're still intending to add a new button here
Comment #21
dww+1 to this change. Reminds me a bit of the debate around where you should go when you save a new media entity. 😅 I think the 2 submit button solution here makes great sense.
There's an MR, so NW is more accurate status.
Thanks!
-Derek
Comment #23
smustgrave commentedUpdated the redirect logic and when the button should appear.
If that looks good we can work on tests.
Comment #24
smustgrave commentedSo changes I made that maybe need discussion.
Changed the new button from "Save and configure" to "Save and place in Block Layout" as Save and configure didn't make much sense to me.
I added the check for "administer blocks" because when #1975064: Add more granular block content permissions lands block layout, block types, and block library will be independent permissions.
Not sure if this is postponed on that.
Comment #25
rkollerI've applied the latest patch and made a few observations.
1. when i am on
/admin/content/block-contentand click theadd custom blockbutton, thechoose a block typepage has the following path/block/add?destination=/admin/content/block-content. the followingadd custom block pagehas only the save button. it's path is/block/add/basic?destination=/admin/content/block-content.if i directly enter the path from the issue summary:
/block/addand choose a block type then i see on theadd custom blockpage thesaveand thesave and place in block layoutbutton. but shouldnt thesave and place in block layoutbutton also be available if you add a custom block by clicking theadd custom blockbutton?2. on the configure block page i've noticed one other detail. maybe it would be useful to provide the context aka in which theme the placement takes place? either in the h1 or in the region label of the select list at the bottom of the page?
3. in regards of the renaming of the
save and place in block layoutbutton label. there are two details to note. before the button was calledsave and configureand the h1 on the linked pageconfigure block. now the button label issave and place in block layoutbut the h1 on the linked page is stillconfigure block. there is a disconnect now. shouldn't the h1 sort of be aligned with the new button label?and in general
save and place in block layouthas too many words even though it is clearer. the rule of thumb from the strategic writing for ux book for button labels is: buttons work best when they are recognizable, specific, and only one or two words long. An alternative for the button label might be "Save and place"? or should the naming adjustments be done in #3318549: Rename Custom Block terminology in the admin UIComment #26
smustgrave commented@rkroller
1. Maybe? I would assume if there destination is there the user would expect to go back to where they came from. I tend to find that majority of blocks we create aren't going to placed in the block layout so think this behavior is correct, if the destination is there it shouldn't go to block layout.
2. I noticed that too. I think it should maybe be a follow up that if you go
block/add -> Save and place -> configure
Somewhere before configure you select the theme. Currently defaults to the front end theme.
3. I like "Save and place" a lot better. Configure makes me think I'm editing the block_content and I don't think I'm configuring to place in the block layout.
Comment #27
rkoller1. but from my understanding, the only way to create a custom block via the interface is on
/admin/content/block-contentby clicking theadd custom blockbutton. the only other option is in layout builder by creating an inline custom block./block/addwithout a destination you are unable to reach without typing that into the address bar arent you? and isnt that the idea of having those two buttons. that the user is able to chose, do i just create the block or do i add config by placing it into a theme? i dont see a problem showing both buttons when theadd custom blockbutton is clicked?2. ah adding an option deciding on the actual theme might be a good idea. and yes definitely something for a followup. how about instead of a
save and place in block layout buttonuse a drop button. the default option could be the default theme and the other options the other installed themes (and that feature would be invisible if a site has only one frontend theme installed) . that way it would be easily and clearly decided and communicated in which context a block is placed? but i would still communicate that choice on the config page still.Comment #28
smustgrave commentedYou can create a custom block via block layout also. If you're going that route then you have "administer blocks" permission and were in the process of placing one.
Comment #29
aaronmchaleRegarding the "save and place" or "save and configure" text, to be honest I do prefer the "save and place", but in the usability review (comment #16) we recommended "save and configure".
Whichever is chosen I agree we should be consistent between the button/link text and the name of the page/form the user lands on.
Comment #30
rkolleri've played around with it a bit more. i think i am able to articulate the problem i have with the current state better now. the current possible use cases are:
1a. i click the
add content block-button on/admin/content/block. when forwarded the destination is appended to the route:/block/add?destination=/admin/content/block=> on the
add content blockpage i only see thesavebutton and on save i get forwarded back to/admin/content/block1b. currently not possible to test but the implementation in admin toolbar will probably mimic the behavior in case 1a.
2. i click the
add content blockbutton on theplace blockmodal on the block layout page on the consecutiveadd content blockpage,?theme=oliverogets appended.=> on the
add content blockpage i only see thesavebutton and on save i get forwarded to theconfigure block-page.3. if i directly go to
/block/add=> without the destination appended on the
add content blockpage i see thesaveandsave and place in block layoutbutton - the feature this patch adds.in summary the behavior for case 2 and 3 is correct and expected, but my problem is with case 1a (and potentially with case 1b if implemented as expected). you only have the option to save and return to
/admin/content/block. but as a user i either go to the/admin/content/blockpage and press theadd content blockbutton or i use the admin toolbar as a direct way to add a new content block. the new functionality the patch introduces would be hidden most of the time (don't know many who directly use/block/addas a shortcut or bookmark). with the patch the decision about the destination is basically up to the users choice. whensaveis pressed the destination is/admin/content/blockwhensave and place in block layoutis pressed the destination is theconfigure blockpage. clear and flexible. for that the appended destination on theadd content block-button on/admin/content/blockjust would have to be stripped out?and in regards of #29 a good point brought up by aaron. i have to admit i completely forgot about our recommendation from the usability meeting. i only considered the
save and place in block layoutbutton label as too long as noted in #25. but i agree with aaron that the choice that is picked should be consistent between button/link text and the h1 of the destination page.on a side note the h1 on the
configure blockpage is sort of unspecific. the title and h1 says simplyconfigure block. in particular screenreader users are missing the context just based on the h1 and title (ref WCAG 2.1 SC 2.4.2 G88 -> The title can be used to identify the Web page without requiring users to read or interpret page content). With justConfigure blockas the h1 and page title the user doesnt know which block the page is about. would it make sense to change the pattern to something likeConfigure [name] content block? and would it make sense to create a follow-up for that?Comment #32
smustgrave commentedI think this is blocked by #2950883: Allow form redirects to ignore ?destination query parameter
Even if I fix #1 in #30 it won't work with the destination parameter.
Comment #33
smustgrave commentedComment #34
smustgrave commentedBlocker has been merged.
Added a simple test assertion.
Comment #35
rkollerI try to sum up the points left open, in part also a summary of the points already voiced in previous comments in here.
1. Currently the
Add content blockstill uses a destination parameter/block/add?destination=/admin/content/block, that way theSaveandSave and place in block layoutbuttons are unreachable. Instead you just get aSavebutton and you are redirected to the set destination/admin/content/block.Only if manually enter the
/admin/content/blockroute without the destination in your browser the new button functionality is accessible. Each of the buttons provides their own destination.Saveforwards back to/admin/content/block</cod> while <code>Save and place in block layoutforwards to the configuration page for the block and afterwards forwards to the block layout page/admin/structure/block.Therefore i am not sure why it is necessary to add the destination paramater
/block/add?destination=/admin/content/blockon theAdd content blockbutton on/admin/content/block, cuz both of the new buttons provide clear destinations. I would just use/block/addfor the code>Add content block button.2. One detail i noticed while writing up the comment on Slack. For blocks created via
/block/addyou have two buttons:SaveandSave and place in block layout. If you create a block via thePlace blockbutton on/admin/structure/blockyou just have a singleSavebutton. Option wise that is correct since you are gonna create a block and place it afterwards in a block layoutanyway. Problem is that the button is calledSavewhich might imply the user would be forwarded to/admin/content/block. Instead i would use the same naming like the second blockSave and place in block layoutfor consistency and clarity reasons?3. In regards of the micro copy of the second button
Save and place in block layoutit is way too long. Torrey Podmajersky puts it the following way in "Strategic Writing for UX":as @aaronmchale noted in #29 the consensus in the ux meeting back then was
Save and configurecuz it is more than just placing the block. for placing the select field at the bottom would already be enough, but you also have the option to change the visibility settings. that was the reasoning behind going withconfigureinstead ofplace.placemight be the better cue for users adding a block for the first time indicating that they gonna place the block after save somewhere. Each of the two variants have their advantages and disadvantages. asking actual users might be helpful in that case. the only thing is thatSave and place in block layoutshould be shortened due to its length in any way.4. Provide more context on the h1. currently it is just called
Configure block. I think the easiest fix might be adding the block name (btw the title is using the same wordConfigurelikeSave and configurein point 3).And in the current state it would make probably sense to also add the theme the block is configured for. but that will be obsolete when the potential follow up in 5 gets in:
5. FOLLOW UP: add a select field to the configure block page right between the visibility settings and the region select field so the user is able to set the theme as well as see the context one is configuring the block for and also knows where the block will be placed in the end.
Blocks created via the
Add content blockbutton could have the default theme as the default option. For blocks created via thePlace blockbutton i would avoid using a select field. it would have to be disabled which brings a11y related issues and also some usability related ones (a source for potential confusion). instead simply list the theme the block is placed in. but best would be to open a dedicated issue for avoiding disabled ui components in general in drupal core, something i am thinking about for a while (either hide components that you are unable to interact with, progressive disclosure so to say, and for others in cases like this show an interface component that looks like a select field but without the carret so it is just for informational purposes without any affordance to interaction)Comment #36
smustgrave commented#35.1 = removed the condition so the 2nd button appears every time for a new block
#35.2 = Updated so when adding block via block layout it will say "Save and configure"
#35.3 = updated to "Save and configure"
#35.4 = Believe that could be a follow up, as that is Drupal wide and not related to just this ticket (may already be a ticket for it)
#35.5 = Agreed in follow up
Surprisingly didn't fail too many tests.
Comment #37
rkollerI've successfully applied the latest changes.
#36.1-3 That looks fab! Awesome!
#36.4 I have no strong opinion if it should happen in this issue or a follow up. So totally fine with the follow up suggestion. and in regards of an already existing ticket. there was a regression ticket for the h1 for content types. the field ux initiative created also one recently. would have to look up the links. so the follow up could orient towards the patterns from there perhaps.
oh and i've noticed one minor detail. happens when the configured block is saved (i "think" i've seen that before). the styling for the active tab is missing :
not sure if the issue should better stay on needs review (cuz i am unable to provide a code review) or better go back to needs work because of the minor detail about the active theme tab. i left the status at needs review for now.
update: took another look and after
Save and configurefor a block added on/admin/content/blocktheis-activeclass is not set for the active secondary tabs link element. the problems does not apply to blocks added via thePlace blockbutton on the block layout page.Comment #38
larowlanLooking good, we're missing some extra tests but other than that I think this is close
Comment #39
smustgrave commentedAdded more tests.
Comment #40
bramdriesenI reviewed the code and it looks really clean. Really great usability addition as well!
There is a test failure though:
And I don't see the "replay" button to re-trigger the test.
Comment #41
smustgrave commentedThat was a pain but think it’s been fixed. Nightwatch seems random
Comment #42
rkollerI've went through testing with the latest patch. The only thing that still applies is the issue about the missing active tab mentioned in #37.
And one other detail I am not sure if it was mentioned before (I've quickly skimmed through but haven't found anything) is if you go to
/admin/structure/block, switch to for example Claro, click the "Place block" button in the "Content" section at the bottom, then click "Add content block" in the modal, select "Basic block", enter a description, click "Save and configure" => the region isn't set to "Content" where the button was initially pressed instead it is set to "-Select-". As I've said not sure if it was already raised nor if it is in the scope for this issue. But it would definitely convenient having it set. For people with a short working memory it might be helpful in case they get uncertain in which context they pressed the "Place block" button. It is easy to fix for the user afterwards but if it would be possible to prevent in the first place by providing some guard rails it might be even better? Those are the only small details aside that it looks great!Comment #43
smustgrave commentedBelieve the issue is going to be handled in #2833116: When Placing a Block on 'Configure Block' page the originally selected region is lost which is also on my radar to pivot to.
Comment #44
rkollerAh thank you! yes that linked issue covers the second point perfectly!
So the only open detail is the first point described in #37 where the
is-activeclass isn't added to the active tab when the user ends up on the block layout page at the end of the add and place a block flow.Comment #45
smustgrave commentedBtw I got around to the block region ticket and put into review
Comment #46
rkollerOne interesting detail that makes #2833116: When Placing a Block on 'Configure Block' page the originally selected region is lost probably also relevant to this issue and the detail i've raised in #37 about
is-activ.I've only applied the MR5562 from #2833116: When Placing a Block on 'Configure Block' page the originally selected region is lost to my test project. I've only manually tested and no matter if i add a new content block or if i place an existing block the region the place block button is pressed is kept. From a functional perspective MR5562 works perfectly. But the detail relevant for this issue.
If you add the block for Olivero, after you save the block the primary tab for Olivero is also missing the
is-activeclass. if you add a block for Claro instead the primary tab is still shown. So since it happens in this issue as well in the slightly different context of #2833116: When Placing a Block on 'Configure Block' page the originally selected region is lost maybe the fix for theis-activeissue for Olivero would make sense to be moved to a follow-up issue?Comment #47
acbramley commentedChecked #46 and confirming that the bug is not related to this ticket. I.e simply visiting /admin/structure/block/list/THEME where THEME is the default theme doesn't correctly highlight the active primary tab. This would be best fixed in a new issue that redirects the default theme to /admin/structure/block
Comment #48
acbramley commented1 minor nit otherwise this is good to go!
Comment #49
smustgrave commentedAddressed feedback
Comment #50
acbramley commentedNice work! This is looking solid now
Comment #53
lauriiiCommitted fca8641 and pushed to 11.x. Thanks!
Comment #55
lauriiiDiscussed with @catch and agreed that this is quite harmless to backport to 10.2.x.
Comment #56
benjifisherI am a little surprised at that decision, since the RC for 10.2.0 was already released. If we were keeping Save (and go to the configuration page) as the primary submit button, then I would agree. But this issue makes that action the secondary button and changes the button text. Now the primary button, still labeled Save, goes somewhere else. I am afraid this will lead to some confusion.
I am also concerned that we are not giving the documentation team enough time to update https://www.drupal.org/docs/user_guide/en/block-create-custom.html, which still has a screenshot of the "Add custom block" page before this change.
Comment #57
lauriiiTo me this doesn't seem like a super commonly occurring bug because this would only happen when the
?destinationquery parameter is not set. If the user navigated to the form using links in the UI, the behavior of the primary submit button would be the same as now. The change they would see is that there's now a secondary button for the alternative action, which also seems like a small enough change to not be disruptive to the UX.I don't see how this renders the documentation you listed invalid. In fact, it's already out of date because it hasn't been updated since #2317981: Move block content edit and delete routes under admin/content/block to improve IA for editors and fix breadcrumbs.
Comment #59
berdirI think this caused a regression with block translations.
Editing no longer goes anywhere, you stay on that page unless you have a destination. Which is fine enough, but this behaviour now also applies to translations and specifically adding a new translation. Staying on the same page results in an exception as that translation then already exists.
I created #3412283: Editing a block_content entity no longer redirects to the overview as a follow-up.
Comment #60
andypostPanels also has issue because of changed signature of
BlockContentForm::actions()#3413891: Panels IPE block content edit form not loading with Drupal 10.2EDIT
https://git.drupalcode.org/project/drupal/-/commit/26446bd20a596316c0284...
but
actions()method is protected inEntityFormComment #61
acbramley commented@andypost is there a reason we changed the sig to public? It seems like we should fix that?