Problem/Motivation

In PHP 8.0, declaring a function required parameter after optional parameters is deprecated. In Views module, \views_plugin_query_default::init has the last $options parameter without a default value, which results in a deprecation notice in PHP 8.0.

Steps to reproduce

  1. Use Drupal 7 (patched for PHP 8) with Views.
  2. Check logs

Proposed resolution

Update \views_plugin_query_default::init function signature (see attached patch)

Remaining tasks

RTBC and commit?

User interface changes

None

API changes

None

Data model changes

None

CommentFileSizeAuthor
php8-views-param-order.patch826 bytesayesh

Issue fork views-3189937

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

Ayesh created an issue. See original summary.

damienmckenna’s picture

So a change like this makes me a little concerned because it's really an API change, but I grepped the ~1,000 D7 modules I have downloaded locally and couldn't find this class extended in any of them. So I think this will be ok.

damienmckenna’s picture

Status: Needs review » Closed (duplicate)
Parent issue: #3118500: Plan for Views 7.x-3.25 » #3207982: PHP 8.0 compatibility for Views 3

Going to fold this into #3207982.

damienmckenna’s picture

Status: Closed (duplicate) » Fixed
Parent issue: #3207982: PHP 8.0 compatibility for Views 3 » #3118500: Plan for Views 7.x-3.25

I decided to commit this separately as it's a small change and it unlocks other PHP 8 issues we'll deal with in the other issue. Thank you!

Status: Fixed » Closed (fixed)

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

joseph.olstad’s picture

Thanks, I will re-trigger file_entity automated tests now and see if that clears it up.

joseph.olstad’s picture