Invalid argument supplied for foreach()

Created on 28 July 2008, about 17 years ago
Updated 17 September 2025, 25 days ago

I'm not sure why my Drupal site is calling the _bio_should_add_nid() function without an object in the view parameter, but in any case I've been getting a ton of errors like these in my watchdog table:

Invalid argument supplied for foreach() in [path]\modules\bio\bio_views.inc on line 259.

My solution is to change lines 259 and 265 so that they have an if (is_array($view->field)) before the foreach ($view->field as $field) (and the same for $filter).

I guess in an ideal world, the foreach() operator would be smart enough to just ignore arguments that are not arrays, but since it's not, we can at least prevent errors this way.

πŸ› Bug report
Status

Closed: outdated

Version

1.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States BenStallings

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024