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
https://www.youtube.com/watch?v=JoW8r1CLzwQ&t=10s
Matt Glaman suggested this as a bug with UMAMI and layout builder. An editor and author should be able to edit and configure the blocks they just created.
Steps to reproduce
Watch the video from 28:09 to see his explanation about it.
Proposed resolution
Add the following default permissions:
Author
- Content - Article: Configure layout overrides for content items that the user can edit
- Content - Basic page: Configure layout overrides for content items that the user can edit
- Content - Recipe: Configure layout overrides for content items that the user can edit
- Create and edit custom blocks
Editor
- Content - Article: Configure layout overrides for content items that the user can edit
- Content - Basic page: Configure layout overrides for content items that the user can edit
- Content - Recipe: Configure layout overrides for content items that the user can edit
- Create and edit custom blocks
Remaining tasks
Manual testing (Novice)- Sort permissions alphabetically (Novice): see Comment #17.
User interface changes
Users with the Author and/or Editor roles will be able to edit layouts in the Umami demo profile.
API changes
None
Data model changes
None
Issue fork drupal-3219967
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:
Comments
Comment #2
bernardm28 CreditAttribution: bernardm28 at The University of Tennessee at Chattanooga commentedComment #5
bernardm28 CreditAttribution: bernardm28 at The University of Tennessee at Chattanooga commentedComment #6
bernardm28 CreditAttribution: bernardm28 at The University of Tennessee at Chattanooga commentedComment #7
bernardm28 CreditAttribution: bernardm28 at The University of Tennessee at Chattanooga commentedComment #9
benjifisherThose permissions were added in #2914486: Add granular permissions to the Layout Builder. I agree that the Author and Editor roles in Umami should have these permissions.
I checked all three content types: Article, Basic page, Recipe. In all three, the Default view mode does not use Layout Builder, but the "Full content" view mode does: for example,
/en/admin/structure/types/manage/article/display/full
. In that view mode, all three content types allow individual nodes to override the default layout.I reviewed the merge request, and it looks good, but I did not test.
A manual test should include at least the following:
/en/admin/people/permissions/module/layout_builder
./en/node/18/layout
.I think the testing is a Novice task, so I am adding the issue tag for that.
Comment #12
gxleano CreditAttribution: gxleano at Factorial GmbH commentedComment #13
gxleano CreditAttribution: gxleano at Factorial GmbH commentedComment #14
gxleano CreditAttribution: gxleano at Factorial GmbH commentedI'll test it!
Comment #15
benjifisher@gxleano:
Thanks for helping with this issue.
Whether or not the testing goes as expected, please give details about how you tested. A few screenshots would help: show the URL and the logged-in user, and perhaps the confirmation message after making changes.
Comment #16
gxleano CreditAttribution: gxleano at Factorial GmbH commentedTested in version 9.2.1-dev, which is the branch the merge request is created against.
TEST RESULT (Step by step)
1. As an Admin user, go to
/admin/people/permissions
and check Layout builder permissions for Author and Editor roles.The permissions below are automatically enabled to the Author and Editor roles:
2. As an Admin user, go to
/admin/structure/types/manage/article/display
and enable "Use Layout Builder" option over Layout options.3. As an Author and Editor user, try to edit the layout of his/him/their existing content (Article, Recipe or Basic Page).
Edited Layout of content
/node/11/edit?destination=/en/admin/content
, adding a Basic block (custom block) and everything is working as expected.To sum up, the code into the MRs looks good to me, and it's working as expected.
Comment #17
benjifisher@gxleano:
Thanks for the testing. Your Comment #16 is just what I had in mind.
Since 9.2.x is not even supported anymore, this issue should really target 10.1.x. The core committers may decide to back-port it to 10.0.x and 9.5.x since it is not a disruptive change. (It affects only new installations of the Umami demo profile.)
I checked, and the patch (or diff) from the merge request applies cleanly to the 10.1.x branch.
I also noticed that, after applying the patch, the permissions are not in alphabetical order. I am sorry I missed that in #9. I am setting the status back to NW for that. I think that fixing the order is a Novice task, so I am leaving that issue tag. I am removing the tag for manual testing. After #16, I do not think we have to re-test.
Comment #19
gxleano CreditAttribution: gxleano at Factorial GmbH commentedI've created a merge request to
10.1.x
adding the permissions ordered alphabetically.Comment #20
lauriiiIt looks like CI is failing for the MR.
Comment #21
joachim CreditAttribution: joachim at Factorial GmbH commentedThese are dependencies that are missing in the role config. Permissions now have dependencies (https://www.drupal.org/node/3055548) and so giving a role a permission for a node type means the role config entity has a dependency on the node type config entity.
(Aside: AssertConfigTrait::assertConfigDiff() should be converted to a PHPUnit custom assertion, and uuuuurgh the Drupal\Component\Diff component has no documentation!!!!)
Comment #22
gxleano CreditAttribution: gxleano at Factorial GmbH commentedComment #23
gxleano CreditAttribution: gxleano at Factorial GmbH commentedComment #24
gxleano CreditAttribution: gxleano at Factorial GmbH commentedI've fixed the Demo Umami test, but now it seems to be unstable with FunctionalJavascript test in CKEditor 5.
Comment #25
gxleano CreditAttribution: gxleano at Factorial GmbH commentedComment #26
joachim CreditAttribution: joachim at Factorial GmbH commentedLGTM!
Comment #27
longwaveUpdating title, and saving issue credit.
Comment #28
longwaveBackported to 10.0.x/9.5.x as a low risk bug fix; the config change only affects newly installed demo sites.
Committed and pushed f0269a4896 to 10.1.x and 6f2b88b8dc to 10.0.x and 3d51469370 to 9.5.x. Thanks!