PHP error when using with faceted search (fix attached)

phayes - September 30, 2009 - 18:15
Project:Conditional Fields
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

When using conditional fields with faceted search the following error often occurs:

warning: Invalid argument supplied for foreach() in /var/www/privatedev/cisdev/sites/all/modules/conditional_fields/conditional_fields.module on line 223.

This can be fixed like so: (starting on line 223)

<?php
      $control_field_name
= $field['control_field_name'];
      foreach (
$node->$control_field_name as $value) {
       
$current_values[$field['control_field_name']] = $value['value'];
        if (!empty(
$value['value']) && $node->content[$field['control_field_name']]['field']['#access'] == TRUE) {
         
$viewed = TRUE;
        }
      }
?>

#1

peterpoe - November 27, 2009 - 22:23

With faceted search 6.x-1.x-dev (2009-Oct-14) I can't reproduce this issue. Do you confirm that it is still happening? When does it happen? In the search results page?

 
 

Drupal is a registered trademark of Dries Buytaert.