Allow restricted blocks to be moved

Created on 19 October 2023, about 1 year ago

Problem/Motivation

We are in the process of deprecating the use of several blocks, but have found that once restricted, the existing blocks can no longer be moved. Ideally, the creation of new blocks would be restricted, but existing blocks would still be able to be moved.

Proposed resolution

By default, allow restricted blocks to be moved, and create a config option to explicitly opt-in to preventing restricted blocks from being moved to preserve current behavior.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rmixter

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

Comments & Activities

  • Issue created by @rmixter
  • πŸ‡ΊπŸ‡ΈUnited States rmixter

    I put together a patch that adds a "Prevent moving restricted blocks" config item and only checks restrictions in the MoveBlockForm and MoveBlockController if it is set to true. I can see this not being ideal if you're using the layout_builder_restrictions_by_region module and it is necessary to prevent moving blocks to specific layouts or regions.

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    Thanks for suggesting this. I agree that there will be sites that want to be able to move blocks that were previously placed in a layout but are now restricted, so I support proceeding with this addition.

    My main reflection is what should be the default behavior and what should the opt-in be:

    By default, allow restricted blocks to be moved, and create a config option to explicitly opt-in

    This proposal would change the default behavior, and make the new opt-in the existing behavior. Beyond the general principle of being hesitant to change existing default behavior, I think there is a specific reason why it may be better to reverse this proposal: Layout Builder provides the ability to create a default layout for entity types. If one of these default layouts included a block type that was subsequently restricted, the initial layout of a new page would allow the ability to move this block, which I think would be counterintuitive to the design if the block type were restricted.

    Therefore, I'd like to propose that the opt-in behavior would be a checkbox to "Allow moving restricted blocks already present in layouts," with description clarification "If a block type that is currently restricted already exists in a layout, allow it to be moved. New instances of restricted blocks still will not be placeable in layouts."

  • Status changed to Needs work about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson
  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson
  • πŸ‡ΊπŸ‡ΈUnited States firewaller

    Patch #2 works for us, but I agree updating from opt-out to opt-in is ideal.

Production build 0.71.5 2024