Problem/Motivation

Deprecated function: strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in views_rss_core_preprocess_views_view_rss()

In views_rss_core_preprocess_views_view_rss() is defaulted to NULL, but this will get run through strtotime() on the first passthrough, to which passing NULL is deprecated.

So if that variable is NULL we can just go ahead and set $this_pub_date I think.

Steps to reproduce

Go to a feed on PHP8.1

Proposed resolution

Add a sanity check.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#2 3266892-2.patch714 byteslendude

Comments

Lendude created an issue. See original summary.

lendude’s picture

StatusFileSize
new714 bytes

This works for me locally

anneke_vde’s picture

Sounds good to set the max_pub_date if the var is NULL, I have no deprecation notices anymore.

damienmckenna’s picture

Status: Active » Needs review
Parent issue: » #2761449: Plan for Advanced Views RSS Feed 8.x-2.0 (for Drupal 9/10)
damienmckenna’s picture

Issue tags: +PHP 8.1

Ran into this in the automated tests.

  • DamienMcKenna committed 4758d09 on 8.x-2.x authored by Lendude
    Issue #3266892 by Lendude, DamienMcKenna, anneke_vde: Passing null to...
damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thank you.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.