Webform Translate conflicts with ECA Form Submit

Created on 22 April 2024, 2 months ago
Updated 29 April 2024, about 2 months ago

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;
      }
🐛 Bug report
Status

Active

Version

6.2

Component

Translation

Created by

🇺🇸United States dehacker

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

Comments & Activities

  • Issue created by @dehacker
  • 🇩🇪Germany jurgenhaas Gottmadingen

    @dehacker I've tried to reproduce this issue, but I'm unable to. I think, I've done all the steps you described above, it works as expected.

    Could you probably export your ECA model and the webform config entity for me to import those into my Drupal site locally to try and reproduce it that way?

Production build 0.69.0 2024