Problem/Motivation

I get this error when trying to enable the module on PHP 8.

Deprecated: Required parameter $tags follows optional parameter $expire in /var/www/html/web/modules/contrib/redis/src/Cache/CacheBase.php on line 360
The website encountered an unexpected error. Please try again later.

Steps to reproduce

Setup Drupal 9.1 on PHP 8 with Redis extension. Add the module, enable it, and add settings required to use Redis for caching.

See https://github.com/hussainweb/drupal-php8-composer2 for sample setup with Drupal 9 and PHP 8.

Proposed resolution

Fix the deprecation by giving a default value for $tags.

Remaining tasks

Patch

User interface changes

None

API changes

Technically, none because currently, the required parameter $tags would be optional anyway.

Data model changes

None

CommentFileSizeAuthor
#2 3174685-2.patch602 byteshussainweb

Comments

hussainweb created an issue. See original summary.

hussainweb’s picture

Status: Active » Needs review
StatusFileSize
new602 bytes

Just this change is enough to get it working. See screenshots at https://twitter.com/hussainweb/status/1312472573825802240

sweetchuck’s picture

Status: Needs review » Reviewed & tested by the community
berdir’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, I went in the opposite direction and just made both arguments required. It practically already was, not passing tags would not have worked.

  • Berdir committed 9a9a8f5 on 8.x-1.x
    Issue #3174685 by hussainweb, Berdir: Required parameter follows...

Status: Fixed » Closed (fixed)

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