I've been trying to figure out why my posting to twitter doesn't work. When Twitter changed to only accepting oauth connections, I followed the thread Authenticate Twitter_Actions.module via OAuth.module 2.x instead of Basic Auth installing every patch as they arrived to solve the issue.
I have now a site where users can log in with twitter, a twitter account can be made global, the twitter module appears to be working, but as people are saying in "says posted to twitter but is not", the module only says it's posted to twitter. It's not posted to twitter.
I have a virgin site with twitter-6.x-3.0-beta2 & oauth-6.x-2.02 installed and working right out of the box, if I set oauth to use plaintext, if I use anything else I get the Invalid Twitter OAuth request described here.
I have uninstalled the modules several times, cleaned out everything named twitter% in the variable table and said DELETE FROM cache WHERE cid = 'variables';, as well as run update.php after reinstalling modules.
There are no mentions of problems in the dblog. I've run cron after every attempt to post to twitter. I've run out of ideas, anyone else experiencing the same issue?
Comments
Comment #1
Rhino commentedExample of stuff deleted from variable that never returned: twitter_global_name & twitter_global_password
| twitter_api_url
| twitter_set_source
| twitter_site_encrypted
| twitter_site_pass
| twitter_site_text
| twitter_site_user
| twitter_types
These days variable looks like this;
| twitter_consumer_key
| twitter_consumer_secret
| twitter_expire
| twitter_import
| twitter_post_default_format
| twitter_post_types
| twitter_signin_button
| twitter_signin_register
I think that is all it needs.
Comment #2
christoph commentedI had the same situation, but I found the problem was a mixture of problematic error reporting in the Twitter module and a setup problem of mine on Twitter.
In summary on Twitter, I had set my application to read-only. Even after setting to read-write it appears that setting is sticky. I had to delete the app, my account settings on Drupal and start again (won't rewrite it all here, but you can see this on my blog at Steps to make Twitter work). And now it is working.
Not sure if I should create a new bug report, but my findings are:-
twitter.lib.php - status_update calls to $this->call (line 147)
twitter.lib.php - call catches any exception and returns FALSE (line 198) - it swallows any errors
twitter.lib.php - request function gets an error from Twitter [data] => {"error":"Read-only application cannot POST","request":"\/statuses\/update.json"} and generates a TwitterException which is swallowed above.
Also the call function doesn't return anything so $result in twitter.post.module (line 92) would not report anything to a user anyway. I'm not an expert in php exception throwing - but maybe if it is the same as java either line 198 on twitter.lib.php should let it be thrown up the stack, or it should rethrow to call in line 147 which should rethrow again so the twitter.post.module has an exception to catch. Just my 2 cents worth.
Thanks for a really useful module
Comment #3
shunshifu commentedThank you. Saved me!
Comment #4
zap-admin commentedI'd like to also second that "Thank You".... instructions on your site were very clear... and now I'm able to post to Twitter again right as I finish a post on a site. Awesome, thanks for taking the time to throw out the short and easy fix.
Jeffrey
Comment #5
parrottvision commentedTwitter kept giving me the fail whale when I tried to delete it so instead I updated the app to be read write and then reset the auth key and secret key. I then updated the twitter module settings with the new auth keys and it worked. Might save some people some time if it works for them also.
Bit annoying that the read - read/write sticks even when you update it but...sigh...what do you do. It's twitter...
Thanks for the post. Awesome!
Comment #6
aze2010 commentedHo Guys :-)
i've tried it as above BUT--it almost doesnt worked for me. Whats wrong...how do i can debug?
Many greetings
Atze
Comment #7
Rhino commentedWish I could pinpoint exactly what saved me, I deleted and reinstalled a few times without any luck, and weeks later when I hadn't touched the issue for a while, it suddenly just worked.
It coincided with a Drupal core update though.
Comment #8
glass.dimly commentedJust posted a patch that addresses this problem:
http://drupal.org/node/437628#comment-3957316
Comment #9
juliakoelsch commentedChristoph,
Thank you! I would have spent hours trying to determine the source of the issue. You provided a clear, helpful description of the problem and instructions to fix it.
I also wasn't able to delete the old application, like parrottvision. It's a known issue at Twitter and they provide a work-around here: http://support.twitter.com/articles/404470-i-can-t-delete-an-application...
Comment #10
glass.dimly commentedClarification: my patch addresses the fact that Twitter module reports a successful post when it has actually failed.
Comment #2 by christoph addresses the problem reported by the bug reporter. I ran into this problem as well when I first installed twitter module.
I'll create a patch for the readme file that adds this caveat to the documentation.
Comment #11
Deviation commentedThe fact that it doesn't report an oAuth error is a bit annoying, but here my fix for it.
-Configure the Twitter application (make sure you set it as read/write)
-Configure the Twitter module in Drupal with the Twitter keys
-Log into Twitter in another window/tab of your browser
-Go to your (User1) profile in Drupal and click Edit->Twitter Accounts
-If you have one listed, delete it
-Click Add Account. You will be redirected to the Twitter authorization page.
-Click Allow
This worked for me anyhow. Best of luck and here's to hoping for better error handling on an otherwise great module.
Comment #12
michaek commented#335459: Does not post to Twitter, despite "Successfully posted to Twitter" message
Comment #13
jonesmac commentedI am stuck at the point where I have to add the twitter account to my drupal user on my site. I click add account, am redirected to twitter, and asked to allow access. If I click allow, the site the displays a pin number that I am supposed to enter somewhere back on my site to "complete the authorization process". Any idea where I am supposed to enter that pin? No where it the twitter setup or user section does it ask for a pin. My twitter account already says my app has read/write access and ready to go, I just can't link my twitter account in drupal. Any thoughts?
Comment #14
michaek commentedThis issue is a duplicate of #335459: Does not post to Twitter, despite "Successfully posted to Twitter" message.
If you're not using the most recent beta of this module (beta-4), please upgrade. If you created your app on Twitter with a prior version, it's likely that you created it in the "wrong" place. See #1164568: Posting problems? Link on settings page to twitter is wrong..
If you're using the most up-to-date code and you're still seeing issues with an app created on dev.twitter.com, please let me know!
Comment #15
jonesmac commentedMine was solved by making the oauth authentication HMAC-SHA1 and setting the callback url to http://www.neo360.org/twitter/oauth
This was nowhere in the documentation that I could easily find. Definitely recommend placing it in the 3.1 readme file or on the module documentation
Comment #16
DoctorGr commentedI´m using www.clicktoapp.com to post by twitter. nice and quickly :-)