Skip to content

Instantly share code, notes, and snippets.

@imcbride
Last active November 8, 2021 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imcbride/42f4163a5e34733b98c0e2510b052dce to your computer and use it in GitHub Desktop.
Save imcbride/42f4163a5e34733b98c0e2510b052dce to your computer and use it in GitHub Desktop.
diff --git a/src/Element/LayoutBuilderUX.php b/src/Element/LayoutBuilderUX.php
index 19ad7dd..664a6ef 100644
--- a/src/Element/LayoutBuilderUX.php
+++ b/src/Element/LayoutBuilderUX.php
@@ -27,7 +27,7 @@ class LayoutBuilderUX implements TrustedCallbackInterface {
$section_label = $build['#attributes']['aria-label'];
$build['configure']['#title'] = t('<span class="visually-hidden">Configure @section</span>', ['@section' => $section_label]);
- $build['configure']['#url'] = Url::fromRoute('layout_builder.configure_section_form', $build['configure']['#url']->getRouteParameters());
+ $build['configure']['#url'] = empty($build['configure']['#url']) ? NULL : Url::fromRoute('layout_builder.configure_section_form', $build['configure']['#url']->getRouteParameters());
$build['remove']['#title'] = t('<span class="visually-hidden">Remove @section</span>', ['@section' => $section_label]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment