Deprecated function issue when passing NULL to UrlHelper::isExternal()

Created on 23 January 2024, 11 months ago
Updated 11 February 2024, 10 months ago

Problem/Motivation

We receive these two errors is a row when displaying an xml feed from a view. They stem from a missing check to ensure the variable passed in exists.

Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in Drupal\Component\Utility\UrlHelper::isExternal() (line 298 of /var/www/html/web/core/lib/Drupal/Component/Utility/UrlHelper.php)

Steps to reproduce

Create a view for a podcast xml feed where there is no value for "itunes:image_field".

Proposed resolution

Added a patch to check the var before trying to use isExternal() method.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States peachez

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

Comments & Activities

Production build 0.71.5 2024