Skip to content
Snippets Groups Projects
Commit 2f7805a1 authored by Pravin Gaikwad's avatar Pravin Gaikwad
Browse files

Fixed php8.1 deprecation notice.

parent 354f9520
No related branches found
No related tags found
No related merge requests found
......@@ -158,7 +158,7 @@ function layout_builder_entity_view_alter(array &$build, EntityInterface $entity
// If the entity is displayed within a Layout Builder block and the current
// route is in the Layout Builder UI, then remove all contextual link
// placeholders.
if ($display instanceof LayoutBuilderEntityViewDisplay && strpos($route_name, 'layout_builder.') === 0) {
if ($display instanceof LayoutBuilderEntityViewDisplay && !empty($route_name) && str_starts_with($route_name, 'layout_builder.')) {
unset($build['#contextual_links']);
}
}
......
......@@ -25,7 +25,7 @@ public static function getLabel() {
* {@inheritdoc}
*/
public function getContext() {
return 'is_layout_builder_ui.' . (int) (strpos($this->routeMatch->getRouteName(), 'layout_builder.') !== 0);
return 'is_layout_builder_ui.' . (int) (str_starts_with($this->routeMatch->getRouteName(), 'layout_builder.') !== 0);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment