TypeError: implode(): Argument #2 ($array) must be of type ?array, string given ... on line 62 of modules/contrib/salesforce/modules/salesforce_logger/src/Form/SettingsForm.php

Created on 10 July 2024, 3 months ago
Updated 30 July 2024, 3 months ago

Problem/Motivation

"TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in implode() (line 62 of modules/contrib/salesforce/modules/salesforce_logger/src/Form/SettingsForm.php)."

Steps to reproduce

  • install salesforce suite 5.1.0
  • enable salesforce_logger module (drush pm:enable salesforce_logger)
  • go to settings form for salesforce_logger (/admin/config/salesforce/logger)
  • the error above is shown

Proposed resolution

line 62:

 '#default_value' => implode("\r\n", $config->get('log_push_params_sanitized_fields') ?? []),

Proposed resolution:

  • ensure that the log_push_params_sanitized_fields config value passed to implode() is an array.
  • modify installed value of log_push_params_sanitized_fields in salesforce_logger.settings.yml to be an array with an empty string.

Remaining tasks

- modify line 62 in salesforce_logger/src/Form/SettingsForm.php to ensure an array is passed to implode()
- modify log_push_params_sanitized_fields in salesforce_logger.settings.yml to be an array with an empty string

User interface changes

- none

API changes

- none

Data model changes

- none

🐛 Bug report
Status

Fixed

Version

5.1

Component

salesforce_logger.module

Created by

🇦🇺Australia thinkingcap

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024