PHP8.1: Deprecation in template_preprocess_date_views_pager()

Created on 12 January 2024, 10 months ago
Updated 15 January 2024, 10 months ago

Problem/Motivation

Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in template_preprocess_date_views_pager()

Steps to reproduce

Appears when pager by date is used on the block display of the view. It don't have url so in the line 88 of date_views/theme/theme.inc:
$prev_path = str_replace($date_info->date_arg, $prev_arg, $date_info->url);
the $date_info->url = null and it causes appearing the deprecation message.

Proposed resolution

I propose to delete $prev_path computing as it's an unused variable.

🐛 Bug report
Status

Needs review

Version

2.9

Component

Code

Created by

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024