diff --git a/core/modules/toolbar/src/Element/ToolbarItem.php b/core/modules/toolbar/src/Element/ToolbarItem.php index 7f0216529ca5..2568b824b9b6 100644 --- a/core/modules/toolbar/src/Element/ToolbarItem.php +++ b/core/modules/toolbar/src/Element/ToolbarItem.php @@ -25,7 +25,7 @@ class ToolbarItem extends RenderElement { ], 'tab' => [ '#type' => 'link', - '#title' => NULL, + '#title' => '', '#url' => Url::fromRoute(''), ], ]; diff --git a/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module b/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module index cbc014054d3c..e399e267ff77 100644 --- a/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module +++ b/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module @@ -45,6 +45,9 @@ function toolbar_test_toolbar() { ], '#weight' => 50, ]; + $items['empty'] = [ + '#type' => 'toolbar_item', + ]; return $items; }