Download & Extend

Notice: Undefined index: und in conditional_fields_evaluate_dependencies() (line 1020 of /..../sites/all/modules/conditional

Project:Conditional Fields
Version:7.x-3.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Hello,

with the the new version I became this issue

Notice: Undefined index: und in conditional_fields_evaluate_dependencies() (line 1020 of /..../sites/all/modules/conditional_fields/conditional_fields.module).

when I save my Profile.

With versions before everything was fine...

Best regards
Frank

Comments

#1

Title:Problem withe the dev version from 5.4.2012» Notice: Undefined index: und in conditional_fields_evaluate_dependencies() (line 1020 of /..../sites/all/modules/conditional

#2

Am I alone with this issue?

Best regards
Frank

#3

I have the same Problem.

Drupal: 7.14
Conditional Fields: 7.x-3.x-dev

#4

Same here.
And I don't know if it's because of that yet, but almost none of the value of the field are displayed.

But I suck when it's time to dig into to catch the problem.

Thanks for any solution.

#5

Priority:normal» major

No. I have the same issue.
I don't know if this is somehow related to profile2 where i activated the conditional field.

"und" should be related to the language. Don't know much more at the moment.

The situation i'm into is this one:

- I have a profile type with many fields
- Field A has C,D,E values and activates respectively field C,D,E.
- If i check C,D or E the module behaves as expected showing the other fields.
- If i check a value on fields C,D,E (Let's say C1, C2, C3 and so on)
once i save i get the aforementioned error and the values don't get saved.

In short: Values of dependant fields don't get saved and i get this error.

Any solution, patch or clue?

#6

I tweaked a bit with the code and i found that the notice is activated by the und value. REmoving the statement on line 1020 deleted the error but didn't allow to save the values of the dependant fields.

#7

Any updates on this? I have the exact same issue.

#8

Hello,

I work with the an older version witch work.

Best regards
Frank

#9

@fraweg

An older version of Profile2 or CF? Which version(s)?

It doesn't seem to fail as long as you aren't using the "has value..." option.

Update: I managed to work around the "has value..." option by using checked/unchecked and changing from 2 radio buttons to a single checkbox. Seems to be working just fine.

#10

Hello,

I don't know witch exact version this is. But this attached works for me.

Best regards
Frank

AttachmentSize
conditional_fields.tar.gz 39.98 KB

#11

i was able to fix this by replacing
$values = $dependee_values_location[$dependee_form_field['#language']];

with
$values = $dependee_values_location[$dependee_form_field['#field_name']][$dependee_form_field['#language']];

I made a patch to do just that:

AttachmentSize
conditional_fields-fixing_und_bug-1562760-11.patch 937 bytes

#12

Thanks a lot stijn.blomme!

This patch works for me!

Best regards
Frank

#13

I can confirm that the old version posted fraweg works, while the patch only removes the error message.
I'm gonna use the old version and as soon as i have some free time i will dig into the code, see the differences and hopefully correct the bug.

#14

Priority:major» normal

Old version posted by fraweg works for me too...

#15

I couldn't patch it but manually, it worked. So many thanks! :-)))

#16

Status:active» reviewed & tested by the community

#11 works for me

#17

Status:reviewed & tested by the community» needs work

That $dependee_form_field['#field_name'] key should not be there. The patch hides the problem but doesn't fix it. I need more information to troubleshoot this issue, including the exact configuration of fields and dependencies, thanks.
I'm attaching a patch that hides the problem in a better way, but don't apply it if you want to help testing.

AttachmentSize
cf-index-und-1562760-17.patch 769 bytes

#18

Component:User interface» Code
Status:needs work» needs review

Another bug #1288522: Compatibility with profile2 (and others?) led me to a possible solution.
Please test this new patch and let me know if the error is solved!

AttachmentSize
cf-index-und-1562760-18.patch 1.79 KB

#19

Hello peterpoe,

#18 works for me.
Thanks for that!

Best regards
Frank

#20

#18 works for me to

Thanks!

#21

is this patch already committed for next release?

#22

Status:needs review» reviewed & tested by the community

#18 works for me too using Profile2

thank you!

#23

In order to get Conditional Fields to work with Commerce Registration, Field Collections and Profile2, I had to use these two patches instead:

http://drupal.org/files/conditional_fields_fixed_multiple_field_collecti... from http://drupal.org/node/1464950
http://drupal.org/files/conditional_fields-support_for_markup_field-1786... from http://drupal.org/node/1786232

I could not apply both this patch and http://drupal.org/files/conditional_fields_fixed_multiple_field_collecti..., but that patch seems to also get Profile2 working?

#24

Status:reviewed & tested by the community» fixed

Committed (with a better/more general solution than #16). Thanks!

#25

Status:fixed» closed (fixed)

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

#26

Every time I try to edit a profile (I'm not using Profile2, installed but disabled) I get this:

Notice: Undefined index: #language en conditional_fields_dependent_validate() (línea 686 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_dependent_validate() (línea 686 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_evaluate_dependencies() (línea 1012 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Warning: Invalid argument supplied for foreach() en conditional_fields_evaluate_dependencies() (línea 1015 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_evaluate_dependencies() (línea 1036 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: #language en conditional_fields_dependent_validate() (línea 686 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_dependent_validate() (línea 686 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_evaluate_dependencies() (línea 1012 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Warning: Invalid argument supplied for foreach() en conditional_fields_evaluate_dependencies() (línea 1015 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_evaluate_dependencies() (línea 1036 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: #language en conditional_fields_dependent_validate() (línea 686 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_dependent_validate() (línea 686 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_evaluate_dependencies() (línea 1012 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Warning: Invalid argument supplied for foreach() en conditional_fields_evaluate_dependencies() (línea 1015 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_evaluate_dependencies() (línea 1036 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: #language en conditional_fields_dependent_validate() (línea 686 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_dependent_validate() (línea 686 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_evaluate_dependencies() (línea 1012 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Warning: Invalid argument supplied for foreach() en conditional_fields_evaluate_dependencies() (línea 1015 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_evaluate_dependencies() (línea 1036 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: #language en conditional_fields_dependent_validate() (línea 686 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_dependent_validate() (línea 686 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_evaluate_dependencies() (línea 1012 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Warning: Invalid argument supplied for foreach() en conditional_fields_evaluate_dependencies() (línea 1015 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_evaluate_dependencies() (línea 1036 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: #language en conditional_fields_dependent_validate() (línea 686 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_dependent_validate() (línea 686 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_evaluate_dependencies() (línea 1012 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Warning: Invalid argument supplied for foreach() en conditional_fields_evaluate_dependencies() (línea 1015 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).
Notice: Undefined index: en conditional_fields_evaluate_dependencies() (línea 1036 de /home/MYSITE/www/SUBFOLDER/sites/all/modules/conditional_fields/conditional_fields.module).

#17 results in:

patching file conditional_fields.module
Hunk #1 FAILED at 1018.
1 out of 1 hunk FAILED -- saving rejects to file conditional_fields.module.rej

#18 results in:

patching file conditional_fields.module
Hunk #1 FAILED at 690.
Hunk #2 FAILED at 1016.
2 out of 2 hunks FAILED -- saving rejects to file conditional_fields.module.rej

#27

Status:closed (fixed)» active

Attached my settings.

Possible duplicate: #1904274: Many errors each time I edit & save a profile as administrator
Maybe this has something to do: #1582094: Incompatibility with Field collection (I'm using Fieldgroup)

AttachmentSize
conditional_fields_01.JPG 100.95 KB
conditional_fields_02.JPG 189.8 KB
conditional_fields_00.JPG 45.11 KB
nobody click here