Problem/Motivation

When installed on PHP 8, the following deprecation notice is present:

Deprecated: Required parameter $bubbleable_metadata follows optional parameter $data in /var/lib/tugboat/web/modules/contrib/publication_date/publication_date.tokens.inc on line 26

Steps to reproduce

  1. Install PHP 8.
  2. Install publication_date module.

Proposed resolution

Make all parameters required. See related issue in token: #3173359: Deprecation errors when trying to install the module on PHP 8

CommentFileSizeAuthor
#7 publication_date-3220692.patch1001 bytesawm
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

markdorison created an issue. See original summary.

markdorison’s picture

Status: Active » Needs review
jozzy_a’s picture

@markdorison can confirm this is working on PHP8.

fengtan’s picture

Related issues: +#3229670: Coding standards
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Can confirm this fixes the warning.

awm’s picture

StatusFileSize
new1001 bytes
smustgrave’s picture

@awm that's the same as the diff from what I can tell?

awm’s picture

smustgrave yup just needed the patch file to safely reference it from composer.json instead of referencing gitlab code patch. Feel free to hide it.

anacolautti’s picture

Hi! I didn't know this, and I love it now that I do. You can get a patch from a merge request in Drupal's gitlab by adding .patch at the end of the URL. For example: https://git.drupalcode.org/project/publication_date/-/merge_requests/3.patch

Ana

  • webflo committed bf92b0f on 8.x-2.x authored by markdorison
    Issue #3220692: Required parameter $bubbleable_metadata follows optional...
webflo’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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