Closed (fixed)
Project:
Twitter
Version:
6.x-3.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
15 Jan 2010 at 18:32 UTC
Updated:
3 Nov 2010 at 15:20 UTC
Jump to comment: Most recent file
Type: php
Invalid argument supplied for foreach() in /usr/home/hoslo/public_html/sites/all/modules/twitter/twitter.lib.php on line 81.
Backtrace: get_statuses(...)[twitter.lib.php:118] <=user_timeline(...)[twitter.inc:90] <=twitter_fetch_user_timeline(a:1:{i:0;s:1:"0";})[twitter.module:116] <=twitter_cron(a:0:{})[:] <=call_user_func_array(...)[module.inc:483] <=module_invoke_all(...)[common.inc:2692] <=drupal_cron_run(a:0:{})[system.admin.inc:1722] <=system_run_cron(a:0:{})[:] <=call_user_func_array(...)[menu.inc:348] <=menu_execute_active_handler(a:0:{})[index.php:18] <=index.php
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | twitter-685964.patch | 5.37 KB | derhasi |
Comments
Comment #1
bcobin commentedSame error - happens on cron run. Any ideas? Thanks!
Comment #2
bcobin commentedProblem seems to be solved - for me. See post here: http://drupal.org/node/720378#comment-2661386
Comment #3
adamyonk commentedI'm getting a similar error every time I run cron. No Twitter statuses get imported and there is one error for each Twitter account that's being checked.
warning: Invalid argument supplied for foreach() in /nfs/c01/h09/mnt/6030/domains/elevatevc.com/html/thought/sites/all/modules/twitter/twitter.lib.php on line 81.Comment #4
skyredwangsame here, on cron run
Comment #5
derhasi commentedThe main reason for the error is a missing return handling in
Twitter::get_statuses(). To fix this I attached a patch.One case get_status (or the call to twitter) fails, is when dealing with protected twitter accounts. Especially if an account has been set to protected on twitter, after it has been created on the drupal site - or the simple one, the password was entered wrong.
For the case a user changes the protection on twitter after the creation on the drupal site, there should be written another patch. Maybe I'll open a new issue for that, when I got a solution.
@walkah / @eaton - the next days I'd like to commit some patches, especially for enabling coordinates support, but also for some authentication fixes (like the one mentioned above).
Comment #6
derhasi commentedMarked #720378: Invalid argument supplied for foreach() on each cron run as duplicate.
Comment #7
klausiPatch applies fine, PHP warning is fixed, code looks good.
Comment #8
bsmith451 commentedI'm have this same error with 6.x-3.0-beta2. Was the patch in this thread included in the beta? I'd like to know before I try to patch the file
Thanks,
Comment #9
derhasi commentedThe patch is not included in the beta, as the dev version is newer than the beta. The patch in #5 should be applied to the current 6.x3-dev.
Comment #10
damienmckenna+1 for inclusion in the next update.
Comment #11
walkah commentedcommitted, thanks folks!