Global Twitter Account does not appear to post user tweets

Frameshift - April 10, 2009 - 04:09
Project:Twitter
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Issue tags:twitter
Description

User level twitter accounts post just fine. What I'm trying to do is set up a twitter account that just references my site, so any and all posts that users place should show up on this "site" account's twitter page. Problem is nothing is being posted.

When entering the global account credentials in the general settings page, I enter userid and password, and save the settings, I see a green announcement that the settings were saved, but the masked password disappears. I also see no log entries for the twitter module.

Any thoughts?

#1

jaydub - April 10, 2009 - 05:59
Version:6.x-2.3» 6.x-2.x-dev

The feature you are referring to does not exist in the released version of the module. There is an issue with patch support for this so if you are having a problem with this patched feature you should followup on that issue.

#369930: Ability to set multiple global Twitter accounts

#2

jaydub - April 11, 2009 - 03:00

my bad, this was added in the last release however it was not mentioned in any of the CVS commit messages so looks like your issue is valid.

#3

webchick - April 11, 2009 - 05:48
Status:active» postponed (maintainer needs more info)

I also see the password disappear, but it looks like the messages still post, so I don't think this is a bug. Can you verify?

The password disappearing I think this is just a characteristic of the Drupal password Form API type. You'll notice that your user account password field does the same thing. It would be pretty lousy security if it embedded your password in plain-text in the HTML as someone could come along behind you and easily nab it.

#4

Frameshift - April 13, 2009 - 03:09

The password disappearing isn't so much the issue. Password masking would be ok. Just not sure if their is any indication that the communication to check the credentials was successful, other than posting a node and seeing if it gets 'tweeted'. (I can't help but think of Tweety and Sylvester when I get the twitter thing going...LOL ;)

From the root account (drupal admin, not linux root) I can see the 'global' account listed under a normal user's twitter accounts, but no 'icon' from the global twitter account that it received, or downloaded, or communicated with twitter successfully. Like you would see with a user-level configuration. When a post is made from a regular, authenticated user, no post is made to the 'global' twitter account. However, the content does post to the user's twitter account.

Does this make sense?

I'm running 6.10, with PHP 5.1.4 and MySQL 5.0.45 on Linux Also I'm running lighty 1.4.19 as the webserver. This is a dedicated box, so I have full control.

#5

Frameshift - April 14, 2009 - 00:30
Status:postponed (maintainer needs more info)» closed

Ok...

Now its working. I'm not sure what changed. But its working correctly now.

#6

Frameshift - April 15, 2009 - 00:43
Status:closed» postponed (maintainer needs more info)

I spoke too soon...

When posting from the site's admin account, and selecting another user-level account, and selecting "post to twitter"... the post goes to thru the global credentials to Twitter.
Any user-level post, DOES NOT POST thru the global account.

What information do you need?

#7

Frameshift - April 21, 2009 - 02:24
Status:postponed (maintainer needs more info)» closed

Closed

#8

robbiethegeek - August 5, 2009 - 15:21

This still seems to be an issue the global user account on submit of the admin form creates the system variable twitter_global_name variable because it is submitted through system_settings_form() without calling another function on submit. On cron it seems that the only twitter accounts updated are the ones that have been added twitter_user (that is populated by the user settings twitter form submission from (that calls twitter_user_save(). So global user account settings aren't added to the twitter_user table.

#9

robbiethegeek - August 5, 2009 - 15:59
Status:closed» active

Forgot to set to active when I added to this issue

Sorry Robbie

#10

gwen - August 6, 2009 - 20:58
Status:active» needs review

I ran into my global account not posting as well and after some digging, I believe this happens whenever the user has access to multiple twitter accounts. The twitter accounts can be multiple ones set by the user OR access to the global account and a personal one set on their account. When that happens, it looks like expected behavior is for a dropdown to appear so the user can choose which account to post to. However, there's a bad line of code that prevents this from showing up. From twitter.inc:

38       $form['account'] = array(
39         '#type' => 'select',
40         '#title' => t('Account'),
41         '#options' => $twitter_accounts,
42         '#access' => user_access(''),
43         '#id' => 'twitter-account',
44       );

There is no argument set for user_access() on line 42, so the user never sees the dropdown. Since there's no value set for that form element, the module does not send info to twitter.

I'm not sure what the proper access permission should be (if any), but attached is a patch against 6.x-2.6 that just removes the line. It may be more appropriate to put a real permission there, but I leave that to the maintainer(s) to decide.

If anyone needs a workaround while the patch is being reviewed, I was able to change the behavior with hook_form_alter() in a custom module, something like this:

function mymodule_form_alter(&$form, $form_state, $form_id) {
  if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
    if (! empty($form['twitter']['account']['#options'])) {
      $form['twitter']['account']['#access'] = 1;
    }  
  }
}

Note that the twitter module's weight is 3, so you'll have to change module weights around to have your module be heavier than twitter module.

AttachmentSize
twitter.patch 532 bytes

#11

gregarios - August 6, 2009 - 21:03
Priority:normal» critical

Suddenly, as of today, my install of 6.x-2.6 is no longer posting tweets to my twitter account via the global twitter acct. Posting a story on my site gives me the "Successfully posted to Twitter" message, but none are posted. Tried resetting passwords, settings, etc, to no avail. Could Twitter have changed something on their end?

#12

gwen - August 6, 2009 - 21:29

@gregarios twitter had a DOS attack earlier so probably there's still some fallout from that.

#13

gregarios - August 8, 2009 - 15:06
Priority:critical» normal

Yes... I see. I can't login or out of Twitter even manually just now.

Update 2009-08-07:
Still no global postings on Twitter.
http://status.twitter.com/post/157979213/restoring-api-and-sms

Update 2009-08-08:
Still no global postings on Twitter.

#14

vacilando - August 7, 2009 - 16:41

I confirm the problem - the global account does not post to Twitter.

gwen's patch in #10 indeed solves this!

#15

gregarios - August 10, 2009 - 01:50
Priority:normal» critical

Still no posting to Twitter, even though the API should be working now.

#16

bjraines - August 14, 2009 - 02:27

You can post to the global by using twitter actions

#17

gregarios - October 25, 2009 - 15:46
Status:needs review» active

You can post to the global by using twitter actions

The twitter actions do work. However, it is not a solution to this issue due to the fact that you cannot control which posts are twittered (tweeted?) and cannot stop them from going out if needed, without going in and disabling the action each time.

The standard global twitter is still not working for me, even though all the settings are set correctly. Only about one in 10 posts somehow gets posted to twitter.

 
 

Drupal is a registered trademark of Dries Buytaert.