ViewInclusion condition causes PHP deprecated function str_replace() notice when site is in maintenance mode

Created on 5 March 2024, over 1 year ago

Problem/Motivation

When you are using the ViewInclusion condition in one or more contexts, and the site is in maintenance mode and a visitor tries to access a page that does not exist, Drupal watchdog logs reports:
```
Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\context\Plugin\Condition\ViewInclusion->evaluate() (line 151
```

Proposed resolution

ViewInclusion evaluate() function needs to check if the current route name is NULL before trying to pass the route name to str_replace().

🐛 Bug report
Status

Active

Version

5.0

Component

Code

Created by

🇺🇸United States aasarava San Diego

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