Closed (fixed)
Project:
Twitter
Version:
7.x-5.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Feb 2013 at 07:06 UTC
Updated:
9 Sep 2015 at 09:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sheldon rampton commentedHere's a patch that eliminates the fatal error.
Comment #2
radimklaskaHi, I have same issue. Your patch removes the error, but I feel like it fixes the consequences, not the real cause.
I have some suspicions that in my case I caused this by doing update without dependencies. I was updating from 6.x-3.something directly to 6.x-5.0 without adding oauth... I will take closer look later.
Comment #3
juampynr commentedAgree with @radimklaska, there is a deeper error in the logic.
This situation can happen when you delete the only authenticated account in your site. Please try the following steps to see if you get the error again:
1. Delete all twitter accounts.
2. Add an authenticated account.
3. Add a non-authenticated account.
4. Delete the authenticated one.
5. Run cron
I think you will get the error because twitter_cron will call user_timeline but crash since there is no authenticated account.
Comment #4
sheldon rampton commentedHm, well, tritter_cron should do something more graceful than crash with a fatal error when there is no authenticated account. The fatal error shuts down the cron process entirely, which will interfere with the proper functioning of other modules that have cron hooks.
Comment #5
damienmckennaI don't think it should block you when trying to delete the last authenticated Twitter account, but maybe there should be some warnings, etc. And it definitely should be handled more gracefully.
Comment #6
damienmckennaThis makes an important change - when twitter_connect() is called the first global authenticated account will be used for the API calls. This will solve the problem of an average user's Twitter account being used for API calls. It also logs a message via watchdog() if there are no global authenticated accounts to use. It also updates all scenarios where twitter_connect() is used to verify that an account was returned.
Comment #7
damienmckennaMinor tweaks.
Comment #8
damienmckennaThis reverts part of the change so it no longer checks for a global authenticated account, and no longer will try to use another account if the submitted account is not authenticated.
Comment #9
damienmckennaPorted to 7.x-5.x
Comment #10
damienmckennaPorted to 7.x-6.x.
Comment #12
damienmckennaCommitted.