strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in frontend_editing_ajax_render_alter()

Created on 29 October 2024, about 2 months ago

Problem/Motivation

Following error message occurs: Deprecated function: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in frontend_editing_ajax_render_alter() (PHP 8.2.24)
\Drupal::routeMatch()->getRouteName() expressly allows NULL returns.

Steps to reproduce

We're observe the issue when a non existing JS map file is loaded.
I'm pretty sure this is not the typical use case (I think the browsers dev tools have to be open) but I'm fairly certain that there can be other occasions where this kicks in.

Proposed resolution

Check if $routeName has something in it to check for.

Remaining tasks

  1. Write code
  2. Tests?
  3. Review
  4. Merge

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland das-peter

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024