Allow regions to be locked

Created on 7 October 2022, over 1 year ago
Updated 9 May 2024, about 2 months ago

Motivation

Provide options to lock down a region within a section so that blocks in that region cannot be added/moved/deleted.

Proposed resolution

For any locked regions in a section, all operations are forbidden by the access controller and contextual links, etc., are removed for unprivileged users.

User interface changes

Add checkboxes for each region to the section configuration form.

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States muriqui

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • Merge request !5Issue #3314133: Allow regions to be locked β†’ (Merged) created by muriqui
  • πŸ‡ΊπŸ‡ΈUnited States dalemoore

    This is so awesome, and puts Layout Builder on closer parity with what WordPress can do with locking different parts of the Full Site Editor. I haven't tested this yet but will soon...

  • πŸ‡§πŸ‡ͺBelgium brentg Ghent

    I've added the patch from @sonfd as a file here so it gets listed on top of the page

  • Assigned to Chester_
  • Assigned to Panchuk
  • Status changed to Needs review 5 months ago
  • πŸ‡ΊπŸ‡¦Ukraine Panchuk Volyn, Lutsk

    I want to review latest MR ASAP and deploy it in the new 2.0.x branch.

    After that, we can create some RC releases with the feature.

  • πŸ‡ΊπŸ‡¦Ukraine Panchuk Volyn, Lutsk

    Okay, I finally configured the environment for the running of the tests.

    I found that LayoutBuilderLockTest::testLock() fell because of the missing $blockId parameter in LayoutBuilderLockTest::checkBlockRouteAccess() method.

    It looks like in Drupal 8/9 there was a way to fetch it via a magic method:

    $blockId = $blockId ?? $this->body_field_block_uuid;
    

    Going to investigate previous commits to the LayoutBuilderLockTest class, and maybe will find something related.

  • πŸ‡ΊπŸ‡¦Ukraine Panchuk Volyn, Lutsk

    Okay, finally I've fixed all the tests. The problem was with the body_field_block_uuid property, which was renamed in previous commits, but not updated in each place of code.

    In addition, there were new style issues with the readme file. Disabled cspell checks for the maintainer's section.

    Rewritten javascript of the module. Instead of jQuery, I used pure JS and removed outdated dependency core/jquery.

  • Pipeline finished with Skipped
    2 months ago
    #156164
  • Issue was unassigned.
  • Status changed to Fixed 2 months ago
  • πŸ‡ΊπŸ‡¦Ukraine Panchuk Volyn, Lutsk

    Merged into 2.x, going to create RC.
    Thanks, everyone for your contribution.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024