Closed (duplicate)
Project:
Conditional Fields
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
13 Feb 2009 at 12:33 UTC
Updated:
9 Jun 2009 at 17:03 UTC
warning: Invalid argument supplied for foreach() in w:\home\takerealty.ru\www\sites\all\modules\conditional_fields\conditional_fields.module on line 194.
These warning appear on main page for all users, except admin
Comments
Comment #1
j.slemmer commentedSee my "solution" on http://drupal.org/node/350411 in post #9 & #10.
The solution needs validating and a patch though.
Comment #2
peterpoe commentedI can't reproduce the issue. Anyway, while investigating, I found a couple of bugs when handling displaying of conditional fields in conditional_fields_nodeapi, which might have been causing this issue. Please update latest dev to test.
Comment #3
DickSwart commentedI get a the same warning but no a different line, this happen when I update or save.
warning: Invalid argument supplied for foreach() in D:\xampp\htdocs\drupal6foxweb\sites\all\modules\conditional_fields\conditional_fields.module on line 738.
Comment #4
jim0203 commentedI'm getting this too, on various lines: 709, 762, 763. Seemingly happens for all non-admin accounts.
D6
CCK 6.x-2.1
Most recent dev release of Conditional Fields.
Comment #5
ericduran commentedI'm using the latest dev.
I'm not sure what's causing everyone else problem but my problem is being cause because I'm using image field.
The problem is this that conditional field tries to prevent an untriggered event from being submitted. In the process it tries to set the value of the untriggered event to the default value. Which works great in almost every field except for an image field because the way it gets the default value.
If you take a look at the code you will see conditional field is looking for 'default_value' the only problem is that the image_field doesn't use 'default_value' it uses 'default_image'.
Anyways, I'm not that worry about resetting a field if it's untriggered so I just comment out that whole section.
Hope this helps.
Comment #6
servantleader commentedSame problem. Same line as #3. (line 738 in 1.0-beta1 and -dev)
foreach ($form['#field_info'][$field_in_group]['widget']['default_value'] as $delta => $value)The conditional fieldgroup in question contains cck date fields, text fields ,and autocomplete text fields, so I am not sure what is causing it. The problem did not start until I updated to 1.0-beta1. - Code has not changed in most resent dev.
Comment #7
servantleader commentedI just verified this problem on a clean install - drupal 6.12 , cck 2.2, date 2.2, latest dev of this module.
Trying to save a conditional group containing a date field with the field not triggered produced this error:
warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\drupaltest\sites\all\modules\conditional_fields\conditional_fields.module on line 738.
Comment #8
fred0 commentedI'm getting the error on line 709 on node creation.
Drupal 6.12
CCK 2.x-dev (2009-May-16)
Date 2.x-dev (2009-May-14)
Comment #9
yrre7 commentedme, too
Comment #10
ruloweb commentedI had the same problem, but in line 711.
I took a look at $form['#field_info'][$field_in_group]['widget']['default_value'] and sometimes it's an array and sometimes is not. So I added a little condition in the "if" above:
before:
after:
it's not the best solution, but it works for me, I'll take a deeper look later.
Hope it helps, thanks!
Conditional Fields 6.x-1.0-beta1
Comment #11
peterpoe commentedMarking this as duplicate of #475884: warning: Invalid argument supplied for foreach() in conditional_fields.module on line 709..
Please report compatibility issues with date module here:
#268560: Compatibilty with date module