Problem/Motivation

When running phpstan-drupal on PHP 8.0.7 I get the following error:

PHP Deprecated: Required parameter $bubbleable_metadata follows optional parameter $data in /data/app/modules/contrib/comment_notify/comment_notify.tokens.inc on line 34

Steps to reproduce

Run phpstan-drupal

Proposed resolution

Remove the optional values and make them required. We are checking for empty anyway.

Remaining tasks

n/a

User interface changes

n/a

API changes

n/a

Data model changes

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

kim.pepper created an issue. See original summary.

kim.pepper’s picture

Status: Active » Needs review

Removes the optional params.

dca123’s picture

Has this fix been applied to dev? I've updated my install to the latest dev and still get the issue.

greggles’s picture

@dca123: This has not been added to the module. The issue status is "Needs review" and there are no commits associated with this issue in git. Can you test out the changes?

Here it is as a patch https://git.drupalcode.org/project/comment_notify/-/merge_requests/3.diff Since it's just one line it should be easy to make the change manually if you want to help test.

Would love to hear any feedback you have. Thanks!

dca123’s picture

Tested the patch and the errors do not happen.

composer.json

 "patches": {
"drupal/comment_notify": {
                "deprecated php bubbledata":"https://git.drupalcode.org/project/comment_notify/-/merge_requests/3.diff"
                }
}

Not sure what else I need to do?

Package operations: 1 install, 0 updates, 0 removals
  - Downloading drupal/comment_notify (1.2.0)
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
  - Installing drupal/comment_notify (1.2.0): Extracting archive
  - Applying patches for drupal/comment_notify
    https://git.drupalcode.org/project/comment_notify/-/merge_requests/3.diff (deprecated php bubbledata)

  • kim.pepper committed 0397bbf on 8.x-1.x
    Issue #3220471:  Required parameter $bubbleable_metadata follows...
greggles’s picture

Status: Needs review » Fixed

That's great, thanks for the feedback. I've now merged it and will give credit to you as a reviewer and kim.pepper as the author.

dca123’s picture

Status: Fixed » Needs review

@greggles
Great!

greggles’s picture

Status: Needs review » Fixed

This is now available in the dev release. I guess in a few months we'll make a new stable release and include this.

Status: Fixed » Closed (fixed)

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