I am using Conditional Fields in D7, and it seems to work fine for creating dependencies between fields in Content Types. However, it does not seem to work at all when I try to specify dependencies between fields in Profile Types that I have created using the Profile2 module.

The Profile Types that I have created (along with all the fields within them) show up perfectly in the Dependencies configuration page for the Conditional Fields module. So I can set up the dependencies just fine for my Profile Types, but they don't actually work - either on the user registration form (when creating a new user account) OR when editing the profile for an existing user.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drwierdo’s picture

Yeah, its not working for me either.It shows the following error as soon as i go to the registration page or the profile edit page:
Notice: Undefined index: field_certificate_program in conditional_fields_field_attach_form() (line 162 of \sites\all\modules\conditional_fields\conditional_fields.module).
Notice: Undefined index: field_level in conditional_fields_field_attach_form() (line 172 of \sites\all\modules\conditional_fields\conditional_fields.module).
Notice: Undefined index: field_level in conditional_fields_field_attach_form() (line 224 of \sites\all\modules\conditional_fields\conditional_fields.module).

What is this supposed to mean? Any suggestion?

bthegc’s picture

For me there are no error messages, it just doesn't do anything as if I hadn't setup any dependencies.

drwierdo’s picture

Yeah, I had those errors because I hadn't updated to latest dev. Now that I have updated it, I do not see the errors, but they appear as if i hadn't done anything...exactly as you are experiencing...did you find any solution??

clashar’s picture

bthegc’s picture

drwierdo: No solution yet - still does nothing when I set up a dependency with Profile2.

peterpoe’s picture

Status: Active » Fixed

Support for Profile2 module has just been committed.

clashar’s picture

Status: Fixed » Active
FileSize
42.79 KB

With new Cond.Fields version of 2011-Aug-05 I am getting:

Notice: Undefined index: dependee in conditional_fields_dependency_add_form_validate() (line 242 of Z:\home\paris9.kz\www\emploi\sites\all\modules\conditional_fields\includes\conditional_fields.admin.inc).
Notice: Undefined index: dependent in conditional_fields_dependency_add_form_validate() (line 242 of Z:\home\paris9.kz\www\emploi\sites\all\modules\conditional_fields\includes\conditional_fields.admin.inc).
You should select two different fields.

And all possible fields are marked/colored with red, please see screenshot.

I was trying to add only 1 dependency, but it seems that module tries to save all open/possible settings.

Please say if I should I open new issue.

peterpoe’s picture

You should checkout from git (see http://drupal.org/project/conditional_fields/git-instructions), or wait until tomorrow, when 7.x-3.x-dev with date 2011-Aug-06 will be automatically built.

eugene_z’s picture

Profile2 works great in 198c2660c182ddd15718190fc2992e4c86c0007d (Aug 6) but appears broken in current 574fccccbdf570504742bdd9fad3db7cf8b927e1 (Aug 30).

bthegc’s picture

Conditional Fields still does not seem to work with Profile2 in the latest dev release from September 4 (9c1c6cd2ea7af1f470151208cfc481fe). Is there any way to get hold of the Aug 6 dev release where Profile2 was supposedly working, since I need the Profile2 functionality? Or better, is there a way/patch to get Profile2 working in the new dev release? Thanks.

laroccadahouse’s picture

subscribing

webadpro’s picture

Im having the same issues. Seems like its not giving any error, and not doing anything either.

rooby’s picture

Priority: Normal » Major

For me it works during registration but not when you go to an existing user and edit their profile.

The problem is that the user_profile_form form (which is used on the profile editing tab of the user account) doesn't have values for #entity_type and #bundle in the complete_form, so it is failing quietly at:

  if (!isset($form_state['complete form']['#entity_type'], $form_state['complete form']['#bundle'])) {
    return $element;
  }

in the conditional_fields_element_after_build() function.

Now I'm not yet knowledgable enough to know whos problem this is.
* It could be that it is conditional_fields relying on values that aren't reliable.
* It could be that the profile2 module should add these values to the form.
* It could maybe be someting wrong with the entity module, maybe?

Someone who has the knowledge will need to work out where this needs to be fixed.

I guess there is potential for this to not work with other modules for the same reason.

rooby’s picture

Status: Active » Closed (duplicate)

Marking as duplicate of #1288522: Compatibility with profile2 (and others?) as that one has a patch.