After installing this module, when viewing certain config or importing config or clearing caches, a warning is displayed:
Array to string conversion ConfigUuidRemapper.php:43
This appears to be specifically related to jsonapi_extras module, where the jsonapi_extras.jsonapi_resource_config.* config has plugins, which may include 'id' as an array of values, and not actually the id of the config/plugin.
After saving that config with this module enabled, there are 500 errors on Json:Api routes:
TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in array_filter() (line 116 of /code/web/modules/contrib/jsonapi_extras/src/ResourceType/ConfigurableResourceType.php).
As this module assumes the id is a string, I've included a patch to explicitly check for that. With this patch applied, and after re-saving the affected configuration, I'm no longer experiencing either warning or error.
| Comment | File | Size | Author |
|---|---|---|---|
| array_to_string_conversion.patch | 851 bytes | lisagodare |
Comments
Comment #2
lisagodareComment #3
lisagodareHere's an excerpt of our jsonapi_extras.jsonapi_resource_config.block-content--basic.yml. The same pattern applies to the contrib content entity type "storage" from the Storage Entities module.
Nodes (e.g. jsonapi_extras.jsonapi_resource_config.node--page.yml), and other content types that do not use 'id' (nid, tid, etc) as the Id field, are not affected.