I have installed the twitter module and it works absolutely fine for one user only.

All other users (administrators with full privileges or not) cannot post to twitter. The Post to twitter tickbox option is not visible when creating new content. All settings appear correct and users have been associated with the global twittter account.

  • It can't have anything to do with permissions because even users with full privileges cannot post tweets
  • I have compared user settings and cannot find anything different
  • I have added and deleted and added again twitter account from all users, including the one for whom this works. Still no luck

What could possibly be the problem here?
Hope someone can help as i am tearing my hear out now.

Comments

josevitalsouto’s picture

I'm having the same problem, the module works only for the "user 1".

sonoutlaw’s picture

Missing permission 'post to twitter'.

In twitter_post.module, on line 29, change the function name from twitter_post_permission to twitter_post_perm

-function twitter_post_permission() {
- return array('post to twitter');
-}

+function twitter_post_perm() {
+  return array('post to twitter');
+}

Now just set the new permission for the role and presto!

evabryn’s picture

Brilliant. It works a treat for me. Thanks sonoutlaw!

tibbsa’s picture

Status: Active » Closed (duplicate)
goglePT’s picture

Assigned: Unassigned » goglePT
Priority: Normal » Minor
Status: Closed (duplicate) » Closed (fixed)

This was, for me, like searching for a needle in a haystack.

Here goes experience:

  1. I did login with "admin" (uid 1)
  2. downloaded 6.x-5.0 at http://drupal.org/project/twitter
  3. unzipped the downloaded twitter-6.x-5.0.zip to /sites/all/modules/twitter
  4. changed the site to Site Configuration>Site Manutention>Off
  5. run mydupalwebsite.com/update.php
  6. went to Site Construction>Modules>List and activated "Twitter", "Twitter actions", "Twitter Post" and confirmed that "OAuth" (6.x-3.0-beta4), and "OAuth Provider UI" was active.
  7. went to "Site Configuration">"Twitter">"Definitions"
  8. there, in order to obtain "OAuth Consumer key" and "OAuth Consumer secret" I clicked "register your application" as sugested.
    1. at Twitter
      1. I created a new aplication
      2. went to aplication "Settings"
      3. set "Access" to "Read, Write and Access direct messages"
      4. set "Callback URL" to "http://www.mydrupalwebsite.com/twitter/oauth" (copied this value from Drupal "Site Configuration">"Twitter">"Definitions") and "Saved"
      5. went to aplication "Details" separator and clicked the button "Recreate my acess token".
  9. returned to Drupal "Site Configuration">"Twitter">"Definitions" and past the "OAuth Consumer key" and "OAuth Consumer secret" from my twitter's aplication "Consumer key" and "Consumer secret" and "Saved"
  10. went to "Site Configuration">"Twitter">"Twitter"
    1. pressed "Go to Twitter and add an Authenticated Account"
      1. it jumped to a link like https://api.twitter.com/oauth/authorize?oauth_token=KWU86jhfdfgddfgQNkDZ...
      2. Logged in to Twitter (if not arlready logged in) and pressed "Authorise aplication"
      3. It jumped to Drupal
        1. If this step went rigth
          1. I see a new tweeter account added to "Site Configuration">"Twitter">"Twitter" and just had to check "Tweets" and "Mentions" and "Save Changes"
        2. If this step went wrong

          (note: this hapeened to me because I tried to add a twitter account with other user that was not admin, before I correct the module bug I talk here in this procedure at step 13 This caused another bug that was not being able to insert/create twitter accounts at "Site Configuration">"Twitter">"Twitter" as I describe below)
          1. I can't see a new twitter added account added to "Site Configuration">"Twitter">"Twitter" and I cant see an input "Twitter Account Name" and a submit button below "Add a non-Authenticated Account". I solved this way:
            1. I went to http://www.idfromuser.com/ and wrote my_twitter_username, submitted and it returned a number that is my twitter ID (like 840396886)
            2. opened my Drupal's mysql database (using phpMyAdmin, in my case)
            3. went to "twitter_account" table > "Insert" separator and inserted by hand the following values
              1. twitter_uid 840396886

                host http://twitter.com

                screen_name my_twitter_username

                oauth_token (I copy past "Access token" at twitter aplication witch is something like 140379654-lAO42juiWFK5tehWsgNB376tYiqJdFTIBLfh3l1Y)

                oauth_token_secret (I copy-past "Access token secret" at twitter aplication that is something like X4QQWoQTeF863sSQHllf8WdttSZqfpby7hd8W2PLk)
            4. and "Saved/Executed/inserted" this values in the table row
            5. went to "Site Configuration">"Twitter">"Twitter", refreshed the page and now I could see the input named "Twitter account name:" and the button "Add a non authenticated account".
              1. wrote ther my twitter username and pressed the button.
                1. Now my twitter account appeared at "Site Configuration">"Twitter">"Twitter"
                  1. Just cheched "Tweets", "Mentions" and pressed "Save changes"
  11. went to "Site Configuration">"Twitter">"Post"
    1. checked "Stories" and other "node types" I want to make publishable to twitter.
    2. checked "Post to twitter by default"
    3. and "Saved"
  12. At this point »only« the admin user could automaticaly post content so twitter every time he goes to "Content Management">"Create Content">"Stories" (or other node type set at "Site Configuration">"Twitter">"Post" to post to twitter)
  13. Now admin user is allowed to publish content to twitter we need to correct a bug directly in the Twitter module code in order to allow any of the other users to publish content and that is documented at http://drupal.org/node/1916120:
    1. In twitter_post.module, on the line 29, change the function name from twitter_post_permission to twitter_post_perm
    2. After this, go to "User Managment">"Permissions" and activate twitter_post module to the other users categories we want to be able to post content to Twitter.
  14. Now the functionality is working properly to all users. Other users can login, go to "Content Management">"Create Content">"Stories" (or other node type set at "Site Configuration">"Twitter">"Post" to post to twitter) and see a new field "Post to Twitter.com".