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:
- #3312252: Unique Field Ajax php 8.1 - Deprecated functions mb_strtolower and addcslashes
- #3374182: Deprecated mb_strtolower triggered from layout_builder PHP 8.1
- #3301692: mb_strtolower(): Passing null to parameter #1 ($string) of type string is deprecated with PHP 8.1
- #3369127: 'filter.format.' . WebformHtmlEditor::DEFAULT_FILTER_FORMAT missing UUID
- #3408809: Fix PHP 8.2+ Drupal Core issues by resolving deprecated function occurrences involving the passing of null
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.