Skip to content

Commit

Permalink
HSD8-000: Add patch to allow group blocks in layout builder (#1475)
Browse files Browse the repository at this point in the history
* HSD8-000: Add patch to allow group blocks in layout builder.
  • Loading branch information
joegl authored Mar 8, 2024
1 parent 42a0793 commit b8c4ce9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@
"https://www.drupal.org/project/drupal/issues/1349080": "https://git.drupalcode.org/project/drupal/-/commit/c271adbb22f28a66ff4321b2fb7f86f20fe0c838.patch",
"https://www.drupal.org/project/drupal/issues/3306916": "https://www.drupal.org/files/issues/2023-12-19/3306916-18.patch",
"views form null fix": "patches/core-views.patch",
"CKEditor 5 headings plugin paragraph label change": "patches/ckeditor5-paragraph-rename.patch"
"CKEditor 5 headings plugin paragraph label change": "patches/ckeditor5-paragraph-rename.patch",
"Allow hs group blocks in layout_builder": "patches/layout_builder-allow-hs-blocks.patch"
},
"drupal/gin": {
"https://www.drupal.org/project/gin/issues/3342513": "https://www.drupal.org/files/issues/2024-02-02/3342513-entity-edit-form-update-ajax-ids-12.patch"
Expand Down
14 changes: 5 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions patches/layout_builder-allow-hs-blocks.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/modules/layout_builder/js/layout-builder.js b/modules/layout_builder/js/layout-builder.js
index 76b751c6..9353579d 100644
--- a/modules/layout_builder/js/layout-builder.js
+++ b/modules/layout_builder/js/layout-builder.js
@@ -460,7 +460,7 @@
$(window).on('drupalContextualLinkAdded', (event, data) => {
const element = data.$el;
const contextualId = element.attr('data-contextual-id');
- if (contextualId && !contextualId.startsWith('layout_builder_block:')) {
+ if (contextualId && !(contextualId.startsWith('layout_builder_block:') || contextualId.startsWith('hs_blocks_block:'))) {
element.remove();
}
});

0 comments on commit b8c4ce9

Please sign in to comment.