Problem/Motivation

Webform element get converted to generic elements when we update/save Email handler of translated webfrom and using language other than source language(en) in URL.

* Document the steps needed to reproduce the bug/issue.

  1. Create a webform in source languge(en) and add field.
  2. Create an Email handler for the webfrom and save it
  3. Translate webform in other language(fr)
  4. Switch User language to fr
  5. Navigate to Email handler and update it.
  6. Navigate back to webfom. You can see element has lost there type and now they are generic elements.

Proposed resolution

Webform elements types should not changed to generic elements even if email handlers are updated from other than source language.

Comments

shubhamporwal14@gmail.com’s picture

Title: Translated Webform elements become geniric element if Email handlers saved from other than source language(en) » Translated Webform elements become generic element if Email handlers are saved from translated language as user interface language.
jrockowitz’s picture

I am almost certain you are running into #2913548: Source element values are replaced with translated values

The lost elements is being triggered because the default language of your website was changed after the webform was created and translated

jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)
jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
shubhamporwal14@gmail.com’s picture

Status: Closed (cannot reproduce) » Postponed (maintainer needs more info)

I really appreciate if you can go through the steps mentioned above or please do check the video attached in the ticket.

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Needs work

I had no idea that the zip file contained a video. I assumed it was your code.

I could not replicate the issue using the described steps but the video clearly shows the problem. I will try again to replicate the issue.

shubhamporwal14@gmail.com’s picture

Hi Jrockwitx,

Can you please post latest update for the issue.

Thanks in advance !!

jrockowitz’s picture

Status: Needs work » Postponed (maintainer needs more info)
StatusFileSize
new10.77 MB

I can't replicate this issue.

I did notice in your video that the "You are editing the original English language for this webform." message is missing when viewing the form builder in a different language.

Is your site's default language 'English'? See #3

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
hmdnawaz’s picture

I'm getting the same issue. Is there any workaround to fix it?

hmdnawaz’s picture

Version: 8.x-5.x-dev » 6.1.3
Status: Closed (cannot reproduce) » Active
interx’s picture

Version: 6.1.3 » 6.2.0-beta4

I have encountered this as well, but from triggering a bulk action in the webform overview page

I used these steps to reproduce this in a vanilla Drupal install:

Using the default site language (EN)

  1. Create a webform in source language (EN) and add some fields.
  2. Translate the webform in other language (French and Dutch in my case)

In the non-default user interface language (FR or NL)

  1. Navigate to the webform overview page (nl/admin/structure/webform)
  2. Use the bulk action to close (or open) a webform and execute it
  3. Navigate back to the webform build, the form definition is overwritten, only the overridden config of the current language is available

If you execute the action in NL, the form definition will be overwritten with the NL translation. If you do this in the FR interface language, the form definition will be overwritten with the FR translations. Only the translation remains, all other info like the type etc is lost, hence the fallback to Generic element.

remco hoeneveld’s picture

StatusFileSize
new785 bytes

there seems to be a fix within the community by combining the following: (this is for Drupal 10.1.* or Drupal 11)

-> https://www.drupal.org/project/drupal/issues/2910353#comment-12422438 Thread of information about the core issue
-> https://git.drupalcode.org/project/drupal/-/merge_requests/6268.diff (diff i created the core patch from)

If you then patch webform with the attached patch after also patching Drupal core then the Config entities cant be overriden anymore.

jrockowitz’s picture

Title: Translated Webform elements become generic element if Email handlers are saved from translated language as user interface language. » [Translations] Translated Webform elements become generic element if Email handlers are saved from translated language as user interface language.
Version: 6.2.0-beta4 » 6.2.x-dev