Problem/Motivation
Error when attempting to add Webform Translate when ECA model using Form submit task is enabled.
Steps to reproduce
Install Drupal 10.2, Webform 6.6.2, ECA 1.1.5.
Create a simple webform with name field and hidden field.
Enable a single ECA model for testing that uses, StartEvent ‘Validate form’ connected to Task ‘Form field: set submitted value’ for name field.
Attempt to add a Webform ‘Translate’ from the Webform UI tab. TypeError string given in Webform translate module.
Turn off the ECA model, the webform is able to create a ‘Translate’ as expected.
TypeError: Drupal\webform\Utility\WebformArrayHelper::addPrefix(): Argument #1 ($array) must be of type array, string given, called in /var/www/html/web/modules/contrib/webform/src/WebformTranslationConfigManager.php on line 286 in Drupal\webform\Utility\WebformArrayHelper::addPrefix() (line 198 of modules/contrib/webform/src/Utility/WebformArrayHelper.php).
TypeError:
in /var/www/html/web/modules/contrib/webform/src/Utility/WebformArrayHelper.php (line 198)
* Prefix to be prepended to all keys.
*
* @return array
* An associative array with all top level keys prefixed.
*/
public static function addPrefix(array $array, $prefix = '#') {
$prefixed_array = [];
foreach ($array as $key => $value) {
if ($key[0] !== $prefix) {
$key = $prefix . $key;
}