PHP 8.1: Deprecation warnings when executing a query within a where condition in Drupal database object

Created on 7 February 2024, almost 2 years ago

Problem/Motivation

We have the same warning as with the Drupal9 version (see ticket https://www.drupal.org/project/drupal/issues/3352318 πŸ› PHP 8.1: Deprecation warnings when executing a query within a where condition in Drupal database object Closed: works as designed )

Executing a query within a where condition in the Drupal database connection class with PHP 8.1 minimum generates deprecation warnings:

Deprecated function: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated en Drupal\Core\Database\Query\Condition->compile()

Deprecated function: strpbrk(): Passing null to parameter #1 ($string) of type string is deprecated en Drupal\Core\Database\Query\Condition->compile()

Deprecated function: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated en Drupal\Core\Database\Query\Condition->mapConditionOperator()

Proposed resolution

We have adapted the patch made in the previous ticket so that it is compatible with version 10.2 : Force data types passed to functions to be strings.

πŸ› Bug report
Status

Active

Version

10.2 ✨

Component
DatabaseΒ  β†’

Last updated 2 months ago

  • Maintained by
  • πŸ‡³πŸ‡±Netherlands @daffie
Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024