Problem/Motivation

When running on PHP 8.4, implicitly marking parameters as nullable (e.g. array &$options = NULL) is deprecated. Rebuilding the cache triggers the following deprecation warning:

Deprecated function: Drupal\contextual_range_filter\Plugin\views\argument\DateRange::init(): Implicitly marking parameter $options as nullable is deprecated, the explicit nullable type must be used instead in include() (line 576 of /var/www/html/vendor/composer/ClassLoader.php).

Steps to reproduce

  • Install and activate the module on a site running PHP 8.4.
  • Rebuild the cache.
  • Observe the deprecation warning.

Proposed resolution

Update DateRange::init() parameter signature to explicitly declare the type as nullable: ?array &$options = NULL, matching the upstream \Drupal\views\Plugin\views\argument\Formula::init() signature in Drupal core.

Remaining tasks

  • Maintainer review

User interface changes

None

Introduced terminology

None

API changes

None

Data model changes

None

Release notes snippet

N/A

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

erkanul created an issue. See original summary.

keerthi kumar made their first commit to this issue’s fork.

keerthi kumar’s picture

I would like to work on this!

keerthi kumar’s picture

Issue summary: View changes
Status: Active » Needs review

Opened MR updating `DateRange::init()` to explicitly type `$options` as nullable (`?array &$options = NULL`) for PHP 8.4 compatibility, matching Drupal core. Moving to Needs review.