Repeatable: Always (three attempts)
Steps to repeat:
1. Upgrade Drupal Core from 7.14 to 7.17
2. Upgrade Twitter module from 7.x-3.0-beta4 to 7.x-4.1
3. Install Twitter library from github in libraries /sites/all/libraries/twitter/ directory
4. Install Oauth module 7.x-3.0
5. Run update.php
6.. Configure Twitter module with oauth consumer key and secret
7. Clear caches
8. Run cron from Drupal Administration
Expected Results:
Cron runs successfully and Twitter feed gets latest information
Actual Results:
After pressing the "Run cron" button, there is a ~2 second pause and then a white screen results. This error is generated:
Fatal error: Call to a member function user_timeline() on a non-object in /var/www/staging/sites/all/modules/contrib/twitter/twitter.inc on line 139
Line 139 in twitter.inc: $statuses = $twitter->user_timeline($account->id, $params);
Twitter feed does not update, and cron is not run successfully. With the Cron Debugger module, when cron is run with the Twitter hook disabled, cron runs normally. No error is logged, but the following message from the Cron Debugger module appears when the page is refreshed:
Cron presumably failed while running the cron hook twitter_cron() in the module twitter.
Note: When Twitter module was upgraded, it was not disabled first due to other module dependencies. The directory twitter was simply deleted, then the new version replaced it, and update.php was run. When Oauth was installed, it automatically was enabled. Also, here are the Twitter settings in the configuration:
Twitter host: http://twitter.com
Twitter API: https://api.twitter.com/1/ (also tried without the "1/" at the end)
Twitter Search: http://search.twitter.com
TinyURL: http://tinyurl.com
Oauth settings are configured with the dev.twitter.com, with the key/secret combination reset and re-input several times and the callback URL correct.
Comments
Comment #0.0
adamdash CreditAttribution: adamdash commentedMistake: error logging wasn't set up properly, the above error was generated referring to: Fatal error: Call to a member function user_timeline() on a non-object in ( $statuses = $twitter->user_timeline($account->id, $params);)
Comment #1
adamdash CreditAttribution: adamdash commentedI'm marking the issue as fixed - I was able to track down that it was the change from not requiring Twitter to authenticate to requiring it. When the Twitter account was removed and readded (in the user settings), and then authorized, everything started working.
Comment #2
betarobot CreditAttribution: betarobot commentedI'd reopen ticket. The issue is: it's ok if you have one user and you (re)authorise it with twitter, but if there are aplenty?
I think instead of showing this error message (for me it comes at the bottom of every the page, because I have twitter block?) twitter module should have a message / call to action at user account screen (main screen, not only twitter) to update users's account with twitter authorisation.
Comment #3
juampynr CreditAttribution: juampynr commentedThis issue has been fixed in 7.x-5.0. Download it from the projects homepage.
Comment #5
vibrasphere CreditAttribution: vibrasphere commentedDrupal 7.19 here. Tried 7.x-5.4 and latest dev and I get:
Fatal error: Call to a member function user_timeline() on a non-object in /sites/all/modules/twitter/twitter.inc on line 197
I also started getting this error after upgrading from older versions. Error crashes down the site when cron is executed manually for example. OAuth and everything installed and configured.
Comment #6
Ambient.ImpactI'm also getting the error as mentioned in #5 above, with the same versions, after upgrading from 3.x.
Comment #7
13rac1 CreditAttribution: 13rac1 commentedSetting correct status. There is no patch here.
Comment #8
juampynr CreditAttribution: juampynr commentedI think that you only have unauthenticated Twitter accounts installed, and no authenticated ones.
I have added a check to prevent twitter_cron() to proceed when the above scenario occurs.
http://drupalcode.org/project/twitter.git/commitdiff/e42ed34
Also I suggest you to upgrade to 7.x-5.x. It does not need libraries module and has an improved UI.
Comment #9
juampynr CreditAttribution: juampynr commentedBackported to 6.x-5.x.
http://drupalcode.org/project/twitter.git/commitdiff/f6aa7da
Comment #10.0
(not verified) CreditAttribution: commentedremoved client information