Problem/Motivation
I'm getting the following error using version 1.3.6 and Drupal Core 10.3.13 attempting to access the settings page at: /admin/config/content/layout_builder_iframe_modal.
This appears to occur when the default 'install' config does not for whatever reason import. It would be good to have a fallback to either default settings here or to at least show the form without values rather than this error:
The website encountered an unexpected error. Try again later.
TypeError: implode(): Argument #1 ($array) must be of type array, string given in implode() (line 74 of modules/contrib/layout_builder_iframe_modal/src/Form/LayoutBuilderIframeModalSettingsForm.php).
Steps to reproduce
Install layout_builder_iframe_modal version 1.3.6 on Drupal Core 10.3.13. Attempt to adjust settings at
Install version 1.3.6 on Drupal Core 10.3.13 and attempt to visit the settings page at /admin/config/content/layout_builder_iframe_modal
Error should appear.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork layout_builder_iframe_modal-3513829
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
brooke_heaton commentedComment #3
dhruv.mittal commentedComment #4
svendecabooterDid you update from a previous version?
If so, did you run update.php or "drush updb"?
Comment #5
svendecabooterComment #6
dhruv.mittal commentedComment #9
aarnau commentedComment #10
svendecabooterThe value is expected to always be an array, either through import of the config via /config/install, or for existing sites, by running database updates. Specifically layout_builder_iframe_modal.post_update.php method layout_builder_iframe_modal_post_update_custom_routes_config() should make this an array, if it isn't already.
Comment #11
dan612 commentedI think this error can be encountered by doing:
A quick fix would be to add the custom_routes key to the layout_builder_iframe_modal.settings :
then import configuration.
Comment #12
svendecabooterComment #13
svendecabooterThat seems more like an issue of a bad workflow regarding config management...
But the proposed fix is fairly straight forward, so will add it as an extra safeguard.
Comment #14
svendecabooter