The video-upload module is installed but I haven't configured a Youtube username and password, so the _video_upload_gdata_get_feed() function will fail.

When I run cron, the module tries to call this, then process the results:

  $feed = _video_upload_gdata_get_feed(VIDEO_UPLOAD_YOUTUBE_DEFAULT_USER_FEED, $connection);
  foreach ($feed as $video) {
    // processing here
  }

If the _video_upload_gdata_get_feed() function fails, it returns false. foreach expects an array, so throws an error. Wrapping an if statement solves this:

  if ($feed = _video_upload_gdata_get_feed(VIDEO_UPLOAD_YOUTUBE_DEFAULT_USER_FEED, $connection)) {
    foreach ($feed as $video) {
      // processing here
    }
  }

Patch attached.

CommentFileSizeAuthor
video_upload.admin_.inc_.patch3.05 KBmanarth

Comments

jhedstrom’s picture

Version: 6.x-1.5 » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

Thanks manarth, committed to 6.x.

jhedstrom’s picture

Status: Patch (to be ported) » Fixed

Committed to 7.x. Thanks again.

Status: Fixed » Closed (fixed)

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