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

  1. Install 8.x-1.0-alpha6
  2. Upgrade to 2.0.1
  3. Open settings form /admin/config/system/m4032404
  4. 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

Command icon 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

ericgsmith created an issue. See original summary.

elc’s picture

Status: Active » Needs work

A hook_update_N would be the better way to handle that. It's missing config specified in the schema that should be there.

elc’s picture

Status: Needs work » Needs review

8.x-1.x branch code can handle the missing value. This update will fix it for the 2.x branch, triggering a release.

elc’s picture

The 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.

ericgsmith’s picture

Status: Needs review » Reviewed & tested by the community

Test 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

  • elc committed 782b3739 on 2.x
    [#3532502] Add update to add missing config values.
    
elc’s picture

Status: Reviewed & tested by the community » Fixed

Trigger for 2.0.2 release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.