Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
blockedmind CreditAttribution: blockedmind commentedthis is kinda urgent. no ideas?
Comment #2
blockedmind CreditAttribution: blockedmind commentedi 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.
Comment #3
nk_ CreditAttribution: nk_ commentedSame error here but seems like blockedmind patch is working.
I think this issue should be considered at least.
Comment #4
casey CreditAttribution: casey commentedcommitted