Site crash when visiting "Retained Config"

Created on 19 July 2023, 12 months ago
Updated 2 August 2023, 11 months ago

Problem/Motivation

When I tried to visit /admin/config/development/configuration/distro/ignore, the site crashed with the following error:

TypeError: implode(): Argument #1 ($pieces) must be of type array, string given in implode() (line 94 of modules/contrib/config_distro/modules/config_distro_ignore/src/Form/SettingsForm.php).

Steps to reproduce

Install distro_update_ignore and visit the path above.

Proposed resolution

The faulty code is this:
implode(PHP_EOL, $settings->get($key))

$settings->get($key) returns NULL, but PHP 8 will not accept this any more and crashes. A fix would be this:
implode(PHP_EOL, $settings->get($key) ?? [])

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇩🇪Germany lukas_w

Live updates comments and jobs are added and updated live.
  • PHP 8.0

    The issue particularly affects sites running on PHP version 8.0.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024