Problem/Motivation

Cannot load the settings page due to error:

TypeError: implode(): Argument #1 ($pieces) must be of type array, string given in implode() (line 223 of modules/contrib/ds/modules/ds_extras/ds_extras.module).

The problem is that the `ds_extras.settings` configuration was never created on our site (not sure why/how). The `ds_extras_form_ds_admin_form_alter` hook in the `ds_extras.module` file loads the `ds_extras.settings` config and attempts to use the values as default values:

line 203 $config = \Drupal::configFactory()->getEditable('ds_extras.settings');
line 223 '#default_value' => implode("\n", $config->get('fields_extra_list')),

The `$config->get('fields_extra_list')` line returns NULL, which produces the fatal error.

Steps to reproduce

1. Navigate to `/admin/structure/ds/settings` and see the error.

Proposed resolution

I do not know how to fix this in code or whether it affects most people. I wasn't sure whether to make a bug or a support request. It's entirely possible we did not run an update correctly in the past and missed when this configuration was installed/created.

I resolved it myself by manually removing the default values from the form and saving the file. I was then able to load the form, save it, and create values for `ds_extras.settings` (and export them to a YML). Now I'm able to load the original form fine.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#3 3383192-3.patch974 byteskeshavv

Comments

joegl created an issue. See original summary.

joegl’s picture

Issue summary: View changes
keshavv’s picture

Status: Active » Needs review
StatusFileSize
new974 bytes

Try it.

joegl’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @keshavv. Confirming patch works.

  • swentel committed a1bb8180 on 8.x-3.x
    Issue #3383192 by keshavv: Cannot load DS settings page (TypeError:...
swentel’s picture

Status: Reviewed & tested by the community » Fixed

It's weird that it happened, but the patch can't hurt, so committed and pushed, thanks!

swentel’s picture

Status: Fixed » Closed (fixed)