- 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 4:37pm 20 October 2023 - πΊπΈUnited States firewaller
Patch #2 works for us, but I agree updating from opt-out to opt-in is ideal.