warning: Invalid argument supplied for foreach() in /sites/all/modules/conditional_fields/conditional_fields.module on line 720.

I have this issue one one of my two sites.

I am using an integer field to control 3 embedded media fields. The other side does not have this problem, but it controls others via a text field.

Comments

peterpoe’s picture

Could you please update conditional fields to the latest cvs version? I moved around a lot of code today, so the line reference is lost. Thanks

RoboPhred’s picture

Status: Active » Fixed

Error does not occur in the current cvs (however, a new issue came up, making a new report).

RoboPhred’s picture

Title: Invalid argument supplied for foreach() on line 720. » Invalid argument supplied for foreach() on line 165.
Status: Fixed » Active

Too soon, came back

warning: Invalid argument supplied for foreach() in /home/third/public_html/showcase/sites/all/modules/conditional_fields/conditional_fields.module on line 165.

function conditional_fields_nodeapi(&$node, $op, $teaser, $page)

      // Create an array with the selected controlling field's values
      $current_values = array();
      foreach ($node->{$field['control_field_name']} as $value) {
         $current_values[] = $value['value'];
      }

This is occurring on the same fields and situations as #458934: Image fields not showing up on 5-10-09 cvs head, however it only ever occurs on saving a node, not on view, and this issue was occurring when the linked issue wasn't.

RoboPhred’s picture

I suspect this is caused by #458964: Conditional settings not cleared on field deletion, I have not seen this come up since I cleared out the duplicate/invalid entries caused by it.

peterpoe’s picture

Status: Active » Closed (duplicate)