Problem/Motivation
We support a Drupal distribution with installation from existing config. This generally works well, except when contrib modules do odd things that break our tests. We're running into just such an issue right now where a sequence of events happens that isn't expected.
webform_install()_webform_update_html_editor()- manually insert
filter.format.webform_default(missing UUID)
StorageComparer::addChangelistUpdate compares uuid values and blows up a non existent uuid array key in the $target_data. Adding a null uuid in the optional config solves this. Leaving things with no uuid at all in the optional config, leads to PHP 8.1 complaining about passing a NULL uuid value to mb_strtolower in ConfigEntityBase and Entity\Query\Condition::compile()
Proposed resolution
Add a null uuid to the optional format configuration.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 3369127-11.patch | 882 bytes | hchonov |
| #4 | 3369127-4.patch | 476 bytes | jrockowitz |
| #2 | 3369127.patch | 332 bytes | heddn |
Comments
Comment #2
heddnComment #3
heddnSee #3302838: Querying with NULL values results in warning mb_strtolower(): Passing null to parameter is deprecated for what this causes.
Comment #4
jrockowitz commentedI did not have time to reproduce the issue but the attached patch might address the root cause which is don't alter config when config is being sync'd
Comment #5
heddnI get the following with the patch in #4:
I got no error with the patch in #2.
Comment #6
jrockowitz commentedI am open to patch #2, I am assuming the filter.format.webform_default does get assigned a UUID.
Comment #7
heddnIf you assign a UUID in your exported config, it will override the null value installed by this module when the exported config is imported. Ideally #2 would assign a unique UUID to the config as it is inserting into the DB. Otherwise, it is gets inserted as a null value and site admins have to ignore the warnings from #3.
Comment #8
jrockowitz commentedMoving this to critical because it should be a release blocker.
@hedden I am fine with your recommendation from #4.
I am changing this to RTBC so that https://www.drupal.org/files/issues/2023-06-23/3369127.patch can be merged.
Comment #10
liam morlandComment #11
hchonovThe real issue here is that
_webform_update_html_editor()is using the config storage directly to write the config and thus leaving the config without an UUID. We identified this since we use the config_plus module that has a protection against saving configs without an UUID. The UUID is being added to an entity only when using the entity storage to save the entity. Therefore we should not be using the config storage here to create config entities but rather the config entity storage. I am attaching a patch that properly installs the config entities.Comment #12
jrockowitz commented@hchonov Thank you for swopping in and saving the day. Your patch looks fine to me.
Comment #14
liam morland