Deprecated function: str_starts_with(): Passing null to parameter #1 ($haystack) of type string is deprecated

Created on 8 September 2023, about 1 year ago
Updated 24 January 2024, 10 months ago

Problem/Motivation

We are getting deprecation notices on 404 pages

Deprecated function: str_starts_with(): Passing null to parameter #1 ($haystack) of type string is deprecated in Drupal\views\Plugin\views\display\DisplayPluginBase->viewExposedFormBlocks() (line 2642 of core/modules/views/src/Plugin/views/display/DisplayPluginBase.php).

It seems that in the function viewExposedFormBlocks it checks the route name to avoid views_ui. routes, but when \Drupal::routeMatch()->getRouteName() returns null it throws the deprecation notice in str_starts_with.

We are running PHP 8.1 with D10.1.2

Steps to reproduce

todo

Proposed resolution

Check the variable is not empty.

Remaining tasks

/

User interface changes

/

API changes

/

Data model changes

/

Release notes snippet

/

🐛 Bug report
Status

Needs work

Version

10.1

Component
Views 

Last updated about 3 hours ago

Created by

🇧🇪Belgium leanderjcc Ghent

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024