When using webform 7.4, and when set LOCALIZATION BY STRING TRANSLATION:
- Expose webform component strings suitable for translation.
- Keep a single webform across a translation set.

In main language webform fields(hide/show) work perfect, in other language this form show all condition fields, in other language all fields are hidden.

And this condition feature, show/hide on user select breaks.

Comments

danchadwick’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)

I apologize, but I don't understand this issue and I'm not very familiar with translation. I don't see the settings that you refer to in the webform source. Are you using another modules for webform translation?

danchadwick’s picture

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

Status: Closed (cannot reproduce) » Active

Translation settings are provided by the "webforms Localization" module, I am having the same issue!

https://www.drupal.org/project/webform_localization

danchadwick’s picture

Project: Webform » Webform Localization
Version: 7.x-4.0-alpha6 » 7.x-4.x-dev

I'm moving this issue to the webform localization issue queue for assistance. If there is actually an issue in webform, I would be most grateful for some background and assistance with a patch.

@dame -- Can you provide some detailed instructions to reproduce the issue. I am not following exactly what suppyx is saying. It seems that the conditionals work properly in the original webform, but not in the translated webform? And I can't tell if all conditional fields are hidden, all are shown, or which fields are having an issue.

I'm happy to coordinate a fix for this issue, but I'll need some help. Many thanks.

gge’s picture

Hello,

I explained this issue here.

Thank you!

Frederic wbase’s picture

Hello

Based on the comments of gge in #5 i've created a patch that alters the js so it uses the correct webform id.
Also changin this status to "needs review".

grts

Frederic

Frederic wbase’s picture

Status: Active » Needs review

Status: Needs review » Needs work
Frederic wbase’s picture

Fixed a small issue, it was not working on the source node anymore

gge’s picture

Hello,

Just tried your patch and it does not working on the source node. Also I want to mention that I'm using Entity Translation.
Also there is a notice:

    Notice: Undefined offset: 11 în webform_localization_js_alter() (linia 944 din /home/public_html/sites/all/modules/webform_localization/webform_localization.module).
    Notice: Undefined offset: 11 în webform_localization_js_alter() (linia 944 din /home/public_html/sites/all/modules/webform_localization/webform_localization.module).
Frederic wbase’s picture

Hello gge

i've hardcoded array key 11, should be better dynamic.
feel free to adjust the patch.

Further more there should be an extra check if tnid != nid but that one is already included in #9

grts

Frederic

Stevel’s picture

Title: LOCALIZATION BY STRING TRANSLATION - condition show/hide not working on other language » Conditionals not working on translations when using 'Localization by String Translation'
Status: Needs work » Needs review
StatusFileSize
new1.26 KB

I've updated the patch to include only the necessary changes, and made it work for any array key.

Stevel’s picture

StatusFileSize
new1.24 KB

Accidentally left in a debug statement. Updated patch

The last submitted patch, 12: 1859860-fix-conditionals-with-string-translation-12.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 13: 1859860-fix-conditionals-with-string-translation-13.patch, failed testing.

Stevel’s picture

Status: Needs work » Needs review

The testbot fails also fail in HEAD, so these have nothing to do with this patch.

Status: Needs review » Needs work

The last submitted patch, 13: 1859860-fix-conditionals-with-string-translation-13.patch, failed testing.

Stevel’s picture

Status: Needs work » Needs review
StatusFileSize
new1.12 KB

The patch doesn't apply anymore. Rerolled the patch without changes

joseph.olstad’s picture

Status: Needs review » Needs work

Hi Stevel, thanks, I reviewed the patch.

It looks like it should work in the case that the option "Keep a single webform across a translation set." is selected
however if that option "Keep a single webform across a translation set." is not selected we'd need an additional check to make sure that the current behaviour stays.

  // Gets webform localization options that match this node ID. 
  $webform_localization_options = webform_localization_get_config($form['nid']['#value']);
  if ($webform_localization_options['single_webform'] > 0) {
     //do stuff
  }
  else {
     //don't do stuff
  }

once this change is added we should be a bit closer to getting this in

also, a minor formatting tidbit, string concatenation according to coding readability standards requires a space before and after the "."

Stevel’s picture

Status: Needs work » Needs review
StatusFileSize
new1.43 KB

Updated the patch according to #21.

Status: Needs review » Needs work

The last submitted patch, 22: 1859860-fix-conditionals-with-string-translation-22.patch, failed testing.

Stevel’s picture

Status: Needs work » Needs review
StatusFileSize
new1.43 KB

Following the 7.x-4.x-branch changes...

  • Stevel authored a1f8d0b on 7.x-4.x
    Issue #1859860 by Stevel, Frederic wbase, joseph.olstad: Conditionals...
joseph.olstad’s picture

Status: Needs review » Fixed

Thanks Stevel!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

knalstaaf’s picture

Are you guys sure this is fixed please?

I'm having the very issue again in 7.x-4.10 (and -dev 02/11/2016).

Edit: the issue occurs when the webform is used as a block: #2829894: Conditionals not working in Webform block

joseph.olstad’s picture

Status: Closed (fixed) » Needs review

Review possibility of regression being reported as described in previous comment.

joseph.olstad’s picture

Status: Needs review » Fixed

see related issue for conditionals when used as a block
#2829894: Conditionals not working in Webform block

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.