Allow authors and editors to edit page layouts in Umami

Created on 21 June 2021, over 3 years ago
Updated 7 February 2023, almost 2 years ago

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

  1. 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

๐Ÿ› Bug report
Status

Fixed

Version

10.1 โœจ

Component
Umamiย  โ†’

Last updated 18 days ago

  • Maintained by
  • ๐Ÿ‡ฎ๐Ÿ‡ชIreland @markconroy
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom @smaz
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom @kjay
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States @shaal
Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States bernardm28 Tennessee

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ช๐Ÿ‡ธSpain gxleano Cรกceres
  • ๐Ÿ‡ช๐Ÿ‡ธSpain gxleano Cรกceres
  • ๐Ÿ‡ช๐Ÿ‡ธSpain gxleano Cรกceres

    I'll test it!

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States benjifisher Boston area

    @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.

  • Issue was unassigned.
  • Status changed to RTBC almost 2 years ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain gxleano Cรกceres

    Tested 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:

    • 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.

    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.

  • Status changed to Needs work almost 2 years ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States benjifisher Boston area

    @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.

  • @gxleano opened merge request.
  • Status changed to RTBC almost 2 years ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain gxleano Cรกceres

    I've created a merge request to 10.1.x adding the permissions ordered alphabetically.

  • Status changed to Needs work almost 2 years ago
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland

    It looks like CI is failing for the MR.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim
      array (
        0 => '    - core.entity_view_display.node.article.full',
        1 => '    - core.entity_view_display.node.page.full',
        2 => '    - core.entity_view_display.node.recipe.full',
      ),
    

    These 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!!!!)

  • Status changed to Needs review almost 2 years ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain gxleano Cรกceres
  • Status changed to Needs work almost 2 years ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain gxleano Cรกceres
  • ๐Ÿ‡ช๐Ÿ‡ธSpain gxleano Cรกceres

    I've fixed the Demo Umami test, but now it seems to be unstable with FunctionalJavascript test in CKEditor 5.

  • Status changed to Needs review almost 2 years ago
  • ๐Ÿ‡ช๐Ÿ‡ธSpain gxleano Cรกceres
  • Status changed to RTBC almost 2 years ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim

    LGTM!

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

    Updating title, and saving issue credit.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

    Backported 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!

  • Status changed to Fixed almost 2 years ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024