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.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | twitter-post-invalid-arg-foreach-2607860-2.patch | 651 bytes | kenwest |
Comments
Comment #2
kenwest CreditAttribution: kenwest as a volunteer commentedHere's a patch. If field_get_items() returns FALSE, continue to the next iteration of the surrounding foreach statement.
Comment #3
kenwest CreditAttribution: kenwest as a volunteer commentedComment #4
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedComment #6
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedThank you kenwest.
I`ve fixed some coding standard issues and commit into dev 7.6 branch.
Comment #8
DamienMcKenna