[PHP 8.1] Deprecated function: strpos(): Passing null to parameter #1 LayoutBuilderUiCacheContext.php on line 28

Created on 3 October 2022, over 1 year ago
Updated 29 March 2023, over 1 year ago

Problem/Motivation

After upgrading to Drupal 8.1 I'm seeing this message:

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /var/www/html/docroot/core/modules/layout_builder/src/Cache/LayoutBuilderUiCacheContext.php on line 28

Steps to reproduce

Upgrade to PHP 8.1

Proposed resolution

Similar to https://www.drupal.org/project/styleguide/issues/3258816 β†’
Basically it casts the first parameter forcing to be a string value.

πŸ› Bug report
Status

Fixed

Version

9.5

Component
Layout builderΒ  β†’

Last updated about 13 hours ago

Created by

πŸ‡ͺπŸ‡¨Ecuador afsch Otavalo

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024