Problem/Motivation
After upgrading from 8.x-1.0-alpha6 to 2.0.1 I get a fatal error when accessing the settings form.
TypeError: implode(): Argument #1 ($array) must be of type array, string given in implode() (line 65 of modules/contrib/m4032404/src/Form/M4032404Form.php).
Steps to reproduce
- Install 8.x-1.0-alpha6
- Upgrade to 2.0.1
- Open settings form /admin/config/system/m4032404
Proposed resolution
#3358555: Method to bypass redirection added the pages sequence - this was added to the install config but no update hook was provided to set the default value for existing sites. This wasn't a big issue as the config form handled the config key being missing.
#3431768: Automated Drupal 11 compatibility fixes for m4032404 then introduced a lot of refactoring which does not work with a missing value.
Either:
- handle missing config in the config form or,
- provide an update hook to set a default value if the key is missing
The work around is to either manual edit you config to add the missing default values, or update first to 8.x-1.0, save your config via the UI, then upgrade to 2.0.1
Remaining tasks
- Decide approach
- Implement
- Test
Issue fork m4032404-3532502
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
elc commentedA hook_update_N would be the better way to handle that. It's missing config specified in the schema that should be there.
Comment #4
elc commented8.x-1.x branch code can handle the missing value. This update will fix it for the 2.x branch, triggering a release.
Comment #5
elc commentedThe form shouldn't fail with unexpected inputs either, meaning both an update and a fixed form is needed.
Leaving on NR for feedback, but this should trigger a new release soon.
Comment #6
ericgsmith commentedTest MR and all looks good.
Page loads fine before running update hook so form changes are working 👍
Update hook runs as expected and config after export has been updated with the expected values 👍
Looks good to me! Thank you
Comment #8
elc commentedTrigger for 2.0.2 release.