When I run cron etc, and the cron job modifies and saves a node with a Twitter Post field, I occasionally get the error ...

Invalid argument supplied for foreach() twitter_post.module:41

It seems to happen for older nodes, whose Twitter Post field is null (the node was created before the field was added to the corresponding content type). It happens when field_get_items() returns FALSE.

I'm supplying a patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kenwest created an issue. See original summary.

kenwest’s picture

Here's a patch. If field_get_items() returns FALSE, continue to the next iteration of the surrounding foreach statement.

kenwest’s picture

Status: Active » Needs review
andrey.troeglazov’s picture

Assigned: Unassigned » andrey.troeglazov

  • andrey.troeglazov committed 8674bbb on 7.x-6.x
    Issue #2607860 by kenwest, andrey.troeglazov: Invalid argument supplied...
andrey.troeglazov’s picture

Status: Needs review » Fixed

Thank you kenwest.
I`ve fixed some coding standard issues and commit into dev 7.6 branch.

Status: Fixed » Closed (fixed)

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

DamienMcKenna’s picture