I get this warning... Though it is working...

* warning: Invalid argument supplied for foreach() in E:\Wamp\www\mysite\sites\all\modules\views_customfield\includes\views_customfield_handler_field_phpcode.inc on line 59.
* warning: Invalid argument supplied for foreach() in E:\Wamp\www\mysite\sites\all\modules\views_customfield\includes\views_customfield_handler_field_phpcode.inc on line 59.

What can cause this? How can I solve?

Comments

blockedmind’s picture

this is kinda urgent. no ideas?

blockedmind’s picture

i get myself a temp solution you should consider. it does not correct the code but avoids error.
before the error line contains foreach i check whether the array is empty of not... which goes as:

if(empty($h->field_values[$values->{$h->field_alias}])==false) {
foreach ($h->field_values[$values->{$h->field_alias}] as $k => $v) {
$tmp[$k] = $v;
// clean up a bit
unset($tmp[$k]['#delta']);
unset($tmp[$k]['_nid']);
}
}

the first and last lines are added by me.

nk_’s picture

Same error here but seems like blockedmind patch is working.
I think this issue should be considered at least.

casey’s picture

Status: Active » Fixed

committed

Status: Fixed » Closed (fixed)

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