- Merge request !19Issue #3305640: Add block restriction validation at start of drag β (Open) created by michaellander
- Status changed to Needs work
11 months ago 7:27am 9 January 2024 Reviewing in Drupal 10, I'm unable to reorder any blocks in layout via dragging. I can still drag the element, but the yellow "destination" preview never moves from the original position. This occurs just by having the module enabled, even if no restrictions have been applied.
I am able to reorder blocks if I select the "move" option on an individual block within the layout. Reordering itself seems unaffected - the drag and drop interface seems to be where the failure occurs.
No dblog or console errors were generated.
- Status changed to Needs review
8 months ago 5:56pm 8 April 2024 - πΊπΈUnited States michaellander
Hi @bjc2265, I've tested this again and it's still working for me. Have you seen any error messages in console or drupal logs? I will say that if you have a lot of debugging turned on, or caching turned off, it may be a little slow(as with all things layout builder). Right now the default behavior is to prevent dropping anywhere until validation is done. I could always change it to allow dropping anywhere until validation is finished, which would fall back to the currently build-in validation. With normal cache settings enabled, it has been pretty seamless for me but I want to make sure that's true for others.
- πΊπΈUnited States michaellander
I really think this would be a nice addition to this module, and I would be happy to make it something that is an optional setting if we think it's too big of a change to introduce by default. Would love some feedback from a maintainer. Thank you!
- πΊπΈUnited States brayn7 Lexington, Ky
brayn7 β changed the visibility of the branch 3305640-add-block-restriction to hidden.
- πΊπΈUnited States brayn7 Lexington, Ky
brayn7 β changed the visibility of the branch 3305640-add-block-restriction to active.
- Merge request !28added some basic css to show the area as disabled, added in a message to push... β (Open) created by brayn7
- πΊπΈUnited States daddison
Hi @michaellander. Can you clarify the test scenario for this improvement? Does the
layout_builder_restrictions_by_region
submodule need to be enabled? - πΊπΈUnited States michaellander
@daddison, good question. I believe I wrote it with
layout_builder_restrictions_by_region
enabled, but I don't believe it is required. It should just be respecting whatever the scope of permissions(section vs region) you have configured. The test scenario will be that the region won't even highlight for you to drop a block in unless it's allowed, instead of waiting for you to drop the block and then get the pop-up warning. If you are testing locally, and have cache turned off, along with a lot of dev tools enabled, it may be kind of slow to validate. Though we've been using it in production on a handful of sites and thus far the performance lag has been negligible.