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

Created on 5 March 2024, 4 months ago
Updated 7 March 2024, 4 months 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

Needs review

Version

5.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States aasarava

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024