Issue #3313342 by Rajeshreeputra, idimopoulos, claudiu.cristea, deepakkm, saidatom, afsch, xjm, Bhanu951: [PHP 8.1] Deprecated function: strpos(): Passing null to parameter #1 LayoutBuilderUiCacheContext.php on line 28

merge-requests/3622/merge
Alex Pott 2023-03-09 21:24:16 +00:00
parent 56913d2ad2
commit 341af8bf30
No known key found for this signature in database
GPG Key ID: BDA67E7EE836E5CE
1 changed files with 5 additions and 1 deletions

View File

@ -25,7 +25,11 @@ class LayoutBuilderUiCacheContext extends RouteNameCacheContext {
* {@inheritdoc}
*/
public function getContext() {
return 'is_layout_builder_ui.' . (int) !str_starts_with($this->routeMatch->getRouteName(), 'layout_builder.');
$route_name = $this->routeMatch->getRouteName();
if ($route_name && str_starts_with($route_name, 'layout_builder.')) {
return 'is_layout_builder_ui.0';
}
return 'is_layout_builder_ui.1';
}
}