Querying with NULL values results in warning mb_strtolower(): Passing null to parameter is deprecated

Created on 10 August 2022, about 2 years ago
Updated 29 July 2024, about 1 month ago

Problem/Motivation

This issue was originally brought into focus when PHP 8.1 was introduced.

Error message when enabling modules:

Deprecated function: mb_strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Core\Config\Entity\Query\Condition->compile() (line 39 of core/lib/Drupal/Core/Config/Entity/Query/Condition.php).
Drupal\Core\Config\Entity\Query\Condition->compile(Array) (Line: 85)
Drupal\Core\Config\Entity\Query\Query->execute() (Line: 301)
Drupal\Core\Config\Entity\ConfigEntityBase->preSave(Object) (Line: 124)
Drupal\language\Entity\ConfigurableLanguage->preSave(Object) (Line: 562)
Drupal\Core\Entity\EntityStorageBase->doPreSave(Object) (Line: 517)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 253)
Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object) (Line: 339)
Drupal\Core\Entity\EntityBase->save() (Line: 607)
Drupal\Core\Config\Entity\ConfigEntityBase->save() (Line: 392)
Drupal\Core\Config\ConfigInstaller->createConfiguration('', Array) (Line: 99)
Drupal\features\FeaturesConfigInstaller->createConfiguration('', Array) (Line: 152)
Drupal\Core\Config\ConfigInstaller->installDefaultConfig('module', 'ldp_translation') (Line: 327)
Drupal\Core\Extension\ModuleInstaller->install(Array, 1) (Line: 83)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array) (Line: 175)
Drupal\system\Form\ModulesListConfirmForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
... snipped

Steps to reproduce

Using a supported version of PHP such as 8.1/8.2/8.3/8.4

Enable some custom or contrib module that has configs to install and the config somehow results in a null uuid. After the module is enabled, the error message will be displayed.

RELATED ISSUES LINKED:

Release notes snippet

Make core more resilient to null uuids when using recent versions of PHP
We have a proven tests only failure.
The solution passes the new test.

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Configuration entity 

Last updated 3 days ago

Created by

🇷🇴Romania ciprian.stavovei

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

  • PHP 8.2

    The issue particularly affects sites running on PHP version 8.2.0 or later.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024