I receive this warning:

Warning: Illegal offset type in isset or empty in conditional_fields_element_after_build() line 225 of [..]\sites\all\modules\conditional_fields\conditional_fields.module

This happen when I access the admin page of the "eu_cookie_compliance" module. I looked inside the conditional_fields.module,
and this is the line:

if (isset($element['#language'], $element[$element['#language']], $element[$element['#language']]['#field_name'])) {
    $field = $element[$element['#language']];
  }

What's failing here is the second check (and maybe the third): $element[$element['#language']]

I suppose there are conditions where $element['#language'] is defined, but $element[$element['#language']] is not defined.
So the isset($element[$element['#language']] ) check just give an error.
Any idea? this just give a warning and all the rest seems working correctly, but a warning is a warning... :-)

CommentFileSizeAuthor
warning.jpg385.99 KBfrancoud
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

francoud created an issue.

francoud’s picture

I've found two temporary workarounds:

1) Adding such a patch in the beginning of the "conditional_fields_element_after_build" function works:

function conditional_fields_element_after_build($element, &$form_state) {
    if (isset($element['#language'])) {
    if ($element['#type'] == "form") {   
       return $element;
    }
  }
[...]

but I don't know the side effects.

2) Adding such a patch in the beginning of the "conditional_fields_element_after_build" function also works:

function conditional_fields_element_after_build($element, &$form_state) {
if ((arg(0)=="admin") &&
    (arg(1) == "config") &&
    (arg(2) == "system") &&
    (arg(3) == "eu-cookie-compliance")) {return $element;}
[...]

just for the admin/config/system/eu-cookie-compliance path. But of course it's far to be elegant :-)

Any [better] suggestion? Thanks again