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

Created on 7 February 2024, 11 months 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

Postponed: needs info

Version

10.2

Component
Database 

Last updated 2 days 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