Last active
December 2, 2019 23:54
-
-
Save jeffam/392e7c96351faf36fc084de5e76d6622 to your computer and use it in GitHub Desktop.
Cannot delete or edit a block that is placed in a section of the layout_builder Patch for 8.7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme | |
index 078d2adc80..ee7ffb426b 100644 | |
--- a/core/themes/seven/seven.theme | |
+++ b/core/themes/seven/seven.theme | |
@@ -87,10 +87,11 @@ function seven_preprocess_block_content_add_list(&$variables) { | |
/** | |
* Implements hook_preprocess_block() for block content. | |
* | |
- * Disables contextual links for all blocks. | |
+ * Disables contextual links for all blocks except for layout builder blocks. | |
*/ | |
function seven_preprocess_block(&$variables) { | |
- if (isset($variables['title_suffix']['contextual_links'])) { | |
+ if (isset($variables['title_suffix']['contextual_links']) | |
+ && !isset($variables['elements']['#contextual_links']['layout_builder_block'])) { | |
unset($variables['title_suffix']['contextual_links']); | |
unset($variables['elements']['#contextual_links']); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a modified patch from https://www.drupal.org/project/drupal/issues/3005403#comment-13326977