Implode doesn't work for ConfigLogConfigForm.php

Created on 5 July 2022, over 2 years ago
Updated 1 September 2024, 6 months ago

Problem/Motivation

Cannot access admin/config/development/config_log due to TypeError: implode(): Argument #1 ($pieces) must be of type array, string given in implode() (line 80 of /app/docroot/modules/contrib/config_log/src/Form/ConfigLogConfigForm.php)

Steps to reproduce

1. Install Config_log module on PHP 8.0+ and Drupal 9.3.17+
2. Enable Config_log module
3. Navigate to Config_log module configuration page (admin/config/development/config_log)
4. Result is: "The website encountered an unexpected error. Please try again later."

Proposed resolution

1. update line 80 of src/Form/ConfigLogConfigForm.php from:
'#default_value' => implode(PHP_EOL, $config_log_conf->get('log_ignored_config')),
to:
'#default_value' => preg_split("/\\r\\n|\\r|\\n/", $_GET['log_ignored_config']),

Remaining tasks

1. Review and testing by community

User interface changes

1. None

API changes

1. None

Data model changes

1. None

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024