• I've List(text) field set-up as Check boxes with two allowed values: "PM", "BP". This is in field collection embedded in the form.
  • I've dependency: My field is required when Another field has value "PM". In here, I've 'Insert value from widget' from the checkbox where I'm selecting only one option.

Now it seems conditional_fields_evaluate_dependency() doesn't comparing these values correctly in the following line:

return array_values($dependency_values) == array_values($values);

This is value of $dependency_values:

array (size=2)
  'BP' => string 'BP' (length=2)
  'PM' => null

comparing with $values:

array (size=2)
  0 => 
    array (size=1)
      'value' => string 'PM' (length=2)
  1 => 
    array (size=1)
      'value' => string 'BP' (length=2)

The format of the arrays seems to be completely different, so it'll always return FALSE.


Here are my $options:

array (size=16)
  'state' => string 'required' (length=8)
  'condition' => string 'value' (length=5)
  'grouping' => string 'AND' (length=3)
  'effect' => boolean false
  'effect_options' => 
    array (size=0)
      empty
  'element_view' => 
    array (size=5)
      1 => string '1' (length=1)
      2 => string '2' (length=1)
      5 => int 0
      3 => int 0
      4 => int 0
  'element_view_per_role' => int 0
  'element_view_roles' => 
    array (size=3)
      1 => 
        array (size=5)
          1 => string '1' (length=1)
          2 => string '2' (length=1)
          5 => int 0
          3 => int 0
          4 => int 0
      2 => 
        array (size=5)
          1 => string '1' (length=1)
          2 => string '2' (length=1)
          5 => int 0
          3 => int 0
          4 => int 0
      3 => 
        array (size=5)
          1 => string '1' (length=1)
          2 => string '2' (length=1)
          5 => int 0
          3 => int 0
          4 => int 0
  'element_edit' => 
    array (size=2)
      1 => string '1' (length=1)
      3 => int 0
  'element_edit_per_role' => int 0
  'element_edit_roles' => 
    array (size=3)
      1 => 
        array (size=2)
          1 => string '1' (length=1)
          3 => int 0
      2 => 
        array (size=2)
          1 => string '1' (length=1)
          3 => int 0
      3 => 
        array (size=2)
          1 => string '1' (length=1)
          3 => int 0
  'selector' => string '' (length=0)
  'values_set' => string '1' (length=1)
  'value_form' => 
    array (size=2)
      'BP' => string 'BP' (length=2)
      'PM' => null
  'value' => 
    array (size=1)
      0 => 
        array (size=1)
          'value' => string 'BP' (length=2)
  'values' => 
    array (size=0)
      empty

This could be related to how the field collection is appearing in the entity form.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kenorb created an issue. See original summary.

kenorb’s picture

Issue summary: View changes
kenorb’s picture

Status: Active » Needs review
FileSize
1.49 KB

Wrong patch, ignore it.

kenorb’s picture

FileSize
1.14 KB

Status: Needs review » Needs work

The last submitted patch, 4: conditional_fields.module-2613522.patch, failed testing.

kenorb’s picture

Component: Code » Compatibility w/ other modules
rafenden’s picture

Patch in #3 will break the standard functionality of conditional fields.