0

After recent upgrade of fieldgroup module, the conditional state visibility for field group does not work now.

Please find the previous code that used to work:

function ji_custom_field_group_build_pre_render_alter(&$element) {

  //BioChemistry
  if(isset($element['group_tr_biochemistry'])){
    $element['group_tr_biochemistry']['#states'] = array(
      'visible' => array(
        ':input[name="field_tr_test_ref[und]"]' => array('value' => 12),
      ),
    );
  }


  //CBC
  if(isset($element['group_tr_cbc'])){
    $element['group_tr_cbc']['#states'] = array(
      'visible' => array(
        ':input[name="field_tr_test_ref[und]"]' => array('value' => 15),
      ),
    );
  }
}

However this does not work after the upgrade. I get an PHP notice instead:

Notice: Undefined index: #id in drupal_process_states() (line 4651 of /srv/www/www.example.com/public_html/includes/common.inc).

Do let me know the workaround possible. Thanks.

2

Searched for some time. Tried different options. Finally reverted to older version 1.3 and it worked just fine :)

This was the bug which has not been addressed in the dev version as of now: https://www.drupal.org/node/2283245

Thanks.

1

I fixed this bug by downgrade field group module from 7.x-1.4 to 7.x-1.3

step by step

  1. disable field group module.
  2. delete field group module folder from server.
  3. install module from http://ftp.drupal.org/files/projects/field_group-7.x-1.3.tar.gz
  4. enable module again.
  5. run update.php

It's works for me.

0

Or you can define ids for your groups :

enter image description here

It will fix the message as the JS error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.