i have added my settings to my profile

when i post a blog it says it is added to my twitter account but it is not added

is there a dependency i am missing?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LynnS’s picture

I thought I was having this problem; it turns out that it doesn't post to Twitter until the cron run.

LynnS’s picture

Priority: Normal » Critical

Belay that. It's not working for me, either.

Ken Knowles’s picture

It wasn't working for me, either. However, when I was looking in the database tables relating to twitter, I found an entry for my Drupal user with a null value for the twitter name. I deleted that entry and it worked.

dose_of_insanity’s picture

I hate to be unoriginal, but it's not working for me either. When i post a new item, I see the message 'Successfully posted to Twitter'.

Running cron doesn't help.

reganjcunliffe’s picture

This is happening for me when two different users are sharing the same twitter account

reganjcunliffe’s picture

This is happening for me when two different users are sharing the same twitter account. It works for one, but not the other.

sillygwailo’s picture

Version: 6.x-2.0 » 6.x-2.x-dev
FileSize
587 bytes

Looking at the HTTP messages getting sent back to the module, it appears that Twitter wasn't authenticating since the username wasn't getting passed to the status updating function. Attached is a patch that proposes to fix this. This applies to the dev version of the module.

redrider’s picture

I am have the same problem.

Where exactly does that snippet of code get inserted and into which file?

sillygwailo’s picture

In twitter.inc look for

$sql = "SELECT ta.*, tu.uid, tu.password, tu.import FROM {twitter_user} tu LEFT JOIN {twitter_account} ta ON (tu.screen_name = ta.screen_name) WHERE tu.uid = %d";

and change it to

$sql = "SELECT ta.*, tu.* FROM {twitter_user} tu LEFT JOIN {twitter_account} ta ON (tu.screen_name = ta.screen_name) WHERE tu.uid = %d";

redrider’s picture

I have applied the patch but still no joy - still says it posted to twitter but does not.

As a side note, this module performed as designed on D6.3 but not since I updated to D6.4.

rogermugs’s picture

is it working for anyone? or is this just a handful of people having the issue? it didn't work in 6.3 or 6.8 for me.

has the patch worked for anyone else?

r4ktor’s picture

the patch has worked for me on 6.8

netentropy’s picture

i will test the patch tomorrow

netentropy’s picture

can we confirm this is working now?

ricardoreyna’s picture

nope still not working

redrider’s picture

Still, no joy.

good_man’s picture

not working :\

Jaap Haitsma’s picture

I've applied the patch and it still does not work for me. Weird thing is that it works now and then.

pixelz’s picture

Hi - I too have installed the patch and am also having problems - will retrieve tweets from twitter accounts on each cron run, but will not post out to the twitter accounts associated with the user posting.

btw am on 6.9

eaton’s picture

Looking at the HTTP messages getting sent back to the module, it appears that Twitter wasn't authenticating since the username wasn't getting passed to the status updating function. Attached is a patch that proposes to fix this. This applies to the dev version of the module.

That query change shouldn't change anything, as screen_name is still being pulled in from the tu table; adding ta.* will only give it TWO copies of the user_name data.

One possibility is that if Twitter is experiencing downtime when the message is sent, it will not be re-sent. As mentioned in another thread, I'm going to take a stab at improving the error reporting in version 2.1, so that Twitter outages and other error states are at least logged to the watchdog, making it easier to determine what's happening in cases like this.

The 'dummy record attached to a user account' scenario is another example of error conditions resulting in bad data getting saved, and this should make it easier to stop that.

jaimek’s picture

drupal 6.10 with twitter dev version and the patch is working! (I'm happy even if its not the *correct* fix)

sillygwailo’s picture

I added a patch which (sort of) incorporates my patch above at http://drupal.org/node/356379#comment-1354602 for multiple Twitter accounts with passwords associated with them.

miahawk’s picture

I have not been getting site updates (gathered via feed, or blogged in drupal) to tweet until this morning when I manually ran cron to test something and the items picked up via feed during that cron run were immediately tweeted, but nothing previous.

I was logged in as admin, but cron normally runs as a crontab. could this be part of the problem?

miahawk’s picture

just tried running cron manually logged in as a different user, and my feed said posted to twitter but nothing was tweeted.

nathanmcginty’s picture

Hey guys,

Same thing here. Strangest thing. It was working fine (Drupal 6.x) then - I was convinced to migrate to WP for a while (sheepish grin) and we were posting to Twitter fine from there.

Then, when I tried to switch back to Drupal, it wasn't posting anymore. I get the message, but nothing happens.

I reinitialized passwords on the twitter site but still no luck.

i'll try the cron thing and the patch.

s

nathanmcginty’s picture

Clearing the database worked for me.

I noticed there were a couple of entries with the told Twitter password. Got rid of those and it worked fine.

Antinoo’s picture

I've solved this opening twitter.inc and changing this line:

    if (empty($account['protected']) || empty($account['password'])) {

in function twitter_user_save(), with this line:

    if (empty($account['password'])) {

I don't know what is the $account['protected'] var.
It's never filled when creating a new account, that's why twitter_fetch_account_info() is never called, and account information are not fetched at all.

Please provide a better fix, my one is just a dirty workaround.

Greetings, Giovanni

netentropy’s picture

do we have any workable patches? might as well be organized about this.

lets get a patch together and test it

eaton’s picture

One interim fix is committed as of tonight -- the HTTP response is checked properly after posting a status, so if it isn't authorized or something goes wrong, the HTTP error (401 Unauthorized, in this case) will be noted rather than pretending everything went well.

qenghis’s picture

I just installed the twitter module. I'm getting the 401 unauthorized error when I try to post to twitter. I've verified that the global twitter username and password are correct. How can I troubleshoot this?

qenghis’s picture

It appears that $node->twitter['account'] is blank. I've temporarily worked around the issue by assigning the global twitter account to $node->twitter['account'] in code.

qenghis’s picture

Another issue I noticed that could be giving some people problems. When you edit the twitter module setup, the global account password is not displayed, since it's a password field. If you don't re-enter the password before saving, the module appears to treat the field as blank and clears the previously entered password. This should be changed so that if the password field is blank, the old password is retained. Alternatively, the password field should be pre-populated with the old password, encrypted of course.

sillygwailo’s picture

I updated my patch for multiple accounts for one Drupal user: http://drupal.org/node/356379#comment-1523566

netentropy’s picture

where is the "official" patch?

dzepol’s picture

I just installed and nothing posted. Ran cron, still nothing is posted. I'll try per #27.

***
Update: I did not use #27. I deleted the global twitter settings and added them to the user settings. That didn't work either (gave me 401 Error). I reimplemented the global settings. Ran cron. Twitter was updated. Yay! At least I got one to show up.

singularo’s picture

#27 - http://drupal.org/node/335459#comment-1445928 fixed it for me on a fresh twitter module install.
On another site that has gone through a couple of versions of this module, i didn't notice the bug at all, so it must be fairly new.

funana’s picture

Aquade’s picture

Version: 6.x-2.x-dev » 6.x-3.0-beta2

I also have the same problem but with version 6.x-3.x

j0e’s picture

This happens to me with 6.x-3.0-beta2 on the second time I post a node. First post works fine, but it doesn't work when you edit & resubmit the node and click announce on Twitter. It says it works, but I took a little trip to twitter.com and nothing there, only the first submission shows. Also, another problem with the user profile page, the twitter statuses don't show up like they did in the 2.6 version. And the name is just 's tweets, rather than username's tweets. It is cool to see the whole oauth thing working, but needs a little more tweaking...just a little, but important tweaks nonetheless.
Joseph

yngens’s picture

Exactly the same case as of j0e's

Aquade’s picture

It works for me now. I had two applications on my twitter [ I do not know if this causes the issue], i removed both of them then I made a new one, I re-install my twitter module on my drupal, configured it, then it works perfectly.

j0e’s picture

I re-installed the module, I ran update and nothing changes. Twitter module is only sending one post per node, both in version 2.6 and 3 beta.

j0e’s picture

Just figured out why posting the same node twice wasn't working. I posted the reason at http://drupal.org/node/625554#comment-3083824 which was more specifically dealing with this issue. It's the Twitter API that refuses multiple posts from the same node that have the same content in the tweet. Must change the tweet to re-post to twitter.

SocialNicheGuru’s picture

I am not getting any nodes to post to twitter even if I get the confirmation message like the original poster.

none of the fixes outlined here worked. I used both version 3 beta2 and dev version

Edit:
Tried version 2 and it worked.

Just tested latest 2.6 version dev and it works. It must be specific to version 3.

drupalfan81’s picture

This doesn't even work for the latest beta release. Everything else appears to work. I can at least add the twitter account now and make it global. But when I check the box to post to twitter it adds the node and tells me successfully posted but nothing is posted to twitter. Also I ran the cron job each time after I added the node to see if this helped, nope! Nothing. And why the hell would someone tell this to cron anyways, just post the shit once the node is created, the server is going through all the work of posted the node and info to the database anyways, what is an extra post, also why would you want your twitter account to be flooded with updates all at one time. I would prefer it to happen in realtime.

WHY is there no NOTification on the module homepage that this module doesn't work to post to twitter, isn't that the fundamental piece of this module. I don't understand why nobody else is complaining. I think this module is a fantastic idea and a MUST HAVE for growing your site viral, so I really hope someone gets on this fast, but it's like nobody else is experiencing this problem.

Does anyone have this working???? I would love for you to share with the rest of us. Ever since the oauth release, I don't believe this module has worked since. I was hoping that since there was a new beta release on 10/20, that this would be fixed, why bother releasing a new release if one of the main functions still doesn't work. Back to disabling this module on my site.

Imaaxa-Cory’s picture

I had the same problem, here is the post I found that worked for me.

"Here you go for temporary solution: http://drupal.org/node/404470#comment-3456224
go to #106"

Rhino’s picture

I've used the solution in #106 successfully for two parts of the module: user sign-in, and users imported tweets.

My site no longer posts to twitter however.

On another site that I'm making, I used the latest twitter module, and the oauth required by it, and it works fine. Only one user (uid 1) has a twitter account connected, and it posts to twitter.

So I deleted all my twitter data tables, the two modules, and reinstalled hoping that would solve my issue on my older site (which has many users logging in via twitter, I've saved this data). Still no dice, it says posted to twitter when it hasn't. Running cron makes no difference. (and I agree with "why the hell would you want to send this to cron anyways?")

Rhino’s picture

To rundown what I have done. (since I was asked here to open a new issue http://drupal.org/node/404470#comment-3606328 , this isn't a new issue but we're all tagging along on the old "says it posts to twitter when it doesn't)

I've had twitter on my site since twitter module twitter 6.x-2.0 and patched my way along as twitter module has changed, and some issues were there from the start regarding the "global account" that should allow all users to post to twitter.

I've opened a newer issue here as to not confuse people which version this is regarding: http://drupal.org/node/963264

Tafa’s picture

Hi,

I am having the same problem and I can say I've tried all of the above. However, my poblem is that my twitter account is not even getting acknowledged. It says authentification failed even after entering the correct credentials (i.e. usernames and password from twitter).
Thanks
T

Dr Jay’s picture

I wrestled with this for hours, then on one re-install, I went to authorize the app again and noticed that Twitter was reporting read-only access. Strange, since I was careful, but I went into the app settings on Twitter and changed it to read-write and clicked save. But no matter how many times I did this it still reverted to read-only. Then I had the inspiration to switch to Chrome (was on Firefox) and tried again and it worked! What's more, the module is now working correctly for me as well!

In any case, this solved my problem. To be on the safe side, maybe you all should double-check with Twitter that your app (site) is correctly set to allow posting!

iex’s picture

Your past problem is fixed this way: http://drupal.org/node/1164568
But, It still doesnt work for me, even when app is set to R/W/
When I create a post, message says that it is tweeted successfully, but it is not.
One more things, twitter post are not imorted (and where exactly they should be displayed, on a Twitter tab in user's profile?)

Ayesh’s picture

Running cron solves the problem of twitter importing.
After registering the twitter application, go to dev.twitter.com again and set application access to read.write again.
When the twitter authorize your user and app, if twitter says that the application can't post on behalf of the user, that means error in your twitter application.

Also, setting correct Oauth method is imported, as said in the guide above.

Fredj94’s picture

Hy i does anyone solved the problem ? I have the same problem too... Please if anyone can help, so help... thanks in advance.

michaek’s picture

Version: 6.x-3.0-beta2 » 6.x-3.x-dev

This is still a live issue, it would appear. I went through the steps of setting up the module with OAuth, and I get a success message from the module, but no tweet.

michaek’s picture

Title: says posted to twitter but is not » Does not post to Twitter, despite "Successfully posted to Twitter" message
michaek’s picture

Component: User interface » Twitter API
FileSize
825 bytes

So far, I'm not sure what the issue is, but I've determined that I'm getting no response back from the API call to Twitter. Here's a patch that tells you something's wrong, but it doesn't fix the underlying issue.

michaek’s picture

I don't know why I didn't find it at first, but the instructions in #1164568: Posting problems? Link on settings page to twitter is wrong. completely resolved my problems with posting to Twitter. I still think it's a good idea to throw an error for a NULL result, but it seems to me that the bad link in the module explains most of the trouble people are having.

michaek’s picture

Status: Active » Closed (fixed)

This is committed to dev, working toward a stable release, and I'm going to consider it closed until issues are raised.

dpearcefl’s picture

Status: Closed (fixed) » Needs work

This patch still does not work as twitter_set_status() does not return anything, therefore testing $result does no good.

dpearcefl’s picture

If we change the twitter_set_status() function in twitter.inc to this:

function twitter_set_status($twitter_account, $status) {
  $twitter = twitter_connect($twitter_account);
  return $twitter->status_update($status);
}

we will get some information back.

We will then have to change the test in twitter_post.module

davidneedham’s picture

Status: Needs work » Closed (cannot reproduce)