Webform mapping php8 TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in implode()

Created on 26 January 2023, almost 2 years ago
Updated 3 August 2023, over 1 year ago

Problem/Motivation

We recently updated a site from php7.4 to 8.0 and began getting this error when pushing mapped webform submissions to salesforce:

TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in implode() (line 79 of /modules/contrib/salesforce/modules/salesforce_webform/src/Plugin/SalesforceMappingField/WebformElements.php)

It looks like we need to check to see if $entity->getElementData($main_element_name) is an array and if not set it to an empty array?

πŸ› Bug report
Status

Fixed

Version

5.0

Component

salesforce_webform.module

Created by

πŸ‡ΊπŸ‡ΈUnited States tjhellmann Indianapolis, IN

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.71.5 2024