When translating a node using entity translation, the conditional fields do not work. All dependents are shown, regardless of the value of the dependee. Changing the dependee does not update the dependents.

It works fine when creating a new node, but not when creating a new translation of that node.

After translating a node, editing the translated node works as expected.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rafenden’s picture

I've installed instance of conditional_fields module at simpletest.me with following configuration:

Enabled modules:
entity_translation (7.x-1.0-beta3)
conditional_fields (7.x-3.0-alpha1)

  1. I added new language — Polish.
  2. And I've configured article CT to be translatable with ET
  3. And I've set field dependencies in article CT as follows:
    Tags visible when "Body" field is filled
  4. And then I've created new Article
  5. And then I've clicked Translate tab
  6. And then I've clicked "Add translation" for Polish language.
  7. Conditional fields worked as expected

jamieus, probably you have installed some additional modules that breaks conditional_fields functionality.

rafenden’s picture

Status: Active » Needs review
FileSize
627 bytes

I know what's the problem.
If you're adding translation with entity_translation module some fields in $form array contain different values.

When editing node:
http://take.ms/9YK87

When adding translation:
http://take.ms/NnjiN

The most important difference with those two forms is #field_name key which exists only when adding translation.
Because of that conditional_fields module is using wrong field when adding information about dependencies, see conditional_fields.module:222

ryanoreilly’s picture

Confirming patch in #2 fixes same problem for me.

Tyler the Creator’s picture

Status: Needs review » Reviewed & tested by the community

#2 works for me as well.

natew’s picture

Thanks for the patch, #2 worked for me.

al.ex’s picture

+1 for patch #2.

  • peterpoe committed 27dc426 on 7.x-3.x authored by rafal.enden
    Issue #2125191 by rafal.enden, peterpoe: Conditional fields not working...
peterpoe’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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

steva1982’s picture

Is it possible to commit it in 7.x-3.0-alpha2 version?
Thanks