Problem/Motivation

On PHP 8.1+, a deprecation notice is triggered in Drupal\views_templates\Plugin\ViewsDuplicateBuilderBase::alterViewTemplateAfterCreation() because the $options parameter is implicitly marked as nullable. PHP now requires nullable types to be declared explicitly.

Proposed resolution

Update the method signature to explicitly declare $options as nullable (e.g. ?array or the appropriate type) to align with current PHP requirements and remove the deprecation warning.

API changes

The method signature changes to explicitly mark $options as nullable.

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

joelpittet created an issue. See original summary.

joelpittet’s picture

Status: Active » Needs review

This is a quick fix in all sense of the words.

joelpittet’s picture

Status: Needs review » Fixed

Scope creeped a bit by fixing PHPunit fake test, but this should now pass the phpunit tests (no real tests at the moment)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • joelpittet committed 1aff3be0 on 8.x-1.x
    fix: #3570481 Fix PHP deprecation for implicitly nullable $options in...

Status: Fixed » Closed (fixed)

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