Deprecation notice in PHP 8.1

Created on 16 March 2023, almost 2 years ago

Problem/Motivation

I'm seeing this notice when running in PHP 8.1/Drupal 10:

Deprecated function: Redis::connect(): Passing null to parameter #2 ($port) of type int is deprecated in Drupal\redis\Client\PhpRedis->getClient() (line 32 of /var/www/docroot/modules/contrib/redis/src/Client/PhpRedis.php).
Drupal\redis\Client\PhpRedis->getClient('redis', NULL, NULL, NULL, Array, ) (Line: 179)
Drupal\redis\ClientFactory::getClient() (Line: 49)
Drupal\redis\Cache\RedisCacheTagsChecksum->__construct(Object) (Line: 83)
Drupal\Component\DependencyInjection\PhpArrayContainer->createService(Array, 'cache_tags_provider.container') (Line: 177)
Drupal\Component\DependencyInjection\Container->get('cache_tags_provider.container', 1) (Line: 212)
Drupal\Component\DependencyInjection\PhpArrayContainer->resolveServicesAndParameters(Array) (Line: 62)
Drupal\Component\DependencyInjection\PhpArrayContainer->createService(Array, 'cache.backend.redis') (Line: 177)
Drupal\Component\DependencyInjection\Container->get('cache.backend.redis', 1) (Line: 212)
Drupal\Component\DependencyInjection\PhpArrayContainer->resolveServicesAndParameters(Array) (Line: 73)
Drupal\Component\DependencyInjection\PhpArrayContainer->createService(Array, 'cache.container') (Line: 177)
Drupal\Component\DependencyInjection\Container->get('cache.container') (Line: 539)
Drupal\Core\DrupalKernel->getCachedContainerDefinition() (Line: 910)
Drupal\Core\DrupalKernel->initializeContainer() (Line: 482)
Drupal\Core\DrupalKernel->boot() (Line: 684)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

Configure Redis in PHP 8.1/Drupal 10 environment. Set port to NULL or don't set.

Proposed resolution

Don't pass the null parameters.

πŸ› Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jhedstrom Portland, OR

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jhedstrom
  • Status changed to Closed: works as designed almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States jhedstrom Portland, OR

    Nevermind, this was happening because port was being set to null in the settings file.

Production build 0.71.5 2024