The latest update makes it so I can't post to Twitter. Rolling back to 5.5 works fine. I've tried clearing caches and removing/re-enabling the main (and only) Twitter account that this module is using to post.
exception 'TwitterException' with message 'Forbidden' in /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/sites/all/modules/contrib/twitter/twitter.lib.php:135 Stack trace: #0 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/sites/all/modules/contrib/twitter/twitter.lib.php(100): Twitter->request('https://api.twi...', Array, 'POST') #1 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/sites/all/modules/contrib/twitter/twitter.lib.php(1209): Twitter->auth_request('https://api.twi...', Array, 'POST') #2 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/sites/all/modules/contrib/twitter/twitter.lib.php(339): Twitter->call('statuses/update', Array, 'POST') #3 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/sites/all/modules/contrib/twitter/twitter.inc(178): Twitter->statuses_update('New Literature:...') #4 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/sites/all/modules/contrib/twitter/twitter_post/twitter_post.module(98): twitter_set_status(Object(TwitterUser), 'New Literature:...') #5 [internal function]: twitter_post_node_insert(Object(stdClass)) #6 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/includes/module.inc(857): call_user_func_array('twitter_post_no...', Array) #7 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/modules/node/node.module(1133): module_invoke_all('node_insert', Object(stdClass)) #8 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/modules/node/node.pages.inc(413): node_save(Object(stdClass)) #9 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/includes/form.inc(1464): node_form_submit(Array, Array) #10 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/includes/form.inc(860): form_execute_handlers('submit', Array, Array) #11 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/includes/form.inc(374): drupal_process_form('literature_node...', Array, Array) #12 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/includes/form.inc(131): drupal_build_form('literature_node...', Array) #13 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/modules/node/node.pages.inc(73): drupal_get_form('literature_node...', Object(stdClass)) #14 [internal function]: node_add('literature') #15 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/includes/menu.inc(517): call_user_func_array('node_add', Array) #16 /srv/bindings/8d4d60477e04487289b3630b65e909e7/code/index.php(21): menu_execute_active_handler() #17 {main}
| Comment | File | Size | Author |
|---|---|---|---|
| #22 | twitter-n1943398-21-7.x-6.x.patch | 938 bytes | damienmckenna |
| #21 | twitter-n1943398-21-6.x-5.x.patch | 1.63 KB | damienmckenna |
| #20 | twitter-n1943398-20-7.x-5.x.patch | 1.61 KB | damienmckenna |
Comments
Comment #1
jkew commentedI am having the same issue. However, I uninstalled v5.6 and installed v5.5 and have the same error message (in the log) coming up. Any help would be appreciated. Thanks.
Comment #2
juampynr commentedThe "Forbidden" error happens when you try to post with a non-authenticated Twitter account. Please review the updated installation settings at http://drupal.org/node/1346824.
Comment #3
nwehner commentedIt's definitely authenticated. I even tried removing that account, clearing caches, and authenticating a separate (my personal) Twitter account as opposed to my site's.
Since the re-install of version 5.5 I've had the main authenticated account work just fine on most content types, but it pulls up the Forbidden error message on blogs. Way weird.
Comment #4
Dave Hirschman commentedThis problem occurs for me when the title of the node being posted to twitter is too long. Node titles can be up to 255 characters, but the twitter status must be less than 140 characters. Function twitter_post_nodeapi in file twitter_post/twitter_post.module (either 7.x or 6.x) does not check to see if the complete status message (with all tokens) is less than 140 characters. I believe that Twitter throws the FORBIDDEN error when the tweet is too long. I tested this idea by changing
to
and that eliminates the problem.
Comment #5
nwehner commentedDave certainly seems to have identified the problem - thanks, Dave!
I put his changes in a patch. It fixes all my problems.
Comment #6
dooug commentedTested patch & confirmed it works on latest 7.x-5.x-dev. Thanks!
Comment #7
dooug commentedComment #8
dddave commentedShouldn't this get into a branch before porting?
Secondly I think there is a UX problem that at least needs to be documented for endusers: A tweet might be to long depending on the title (+short url). But this is a general concern.
Comment #9
mastoll commentedA tale of two versions and two features:
I applied patch in #5 to version 7.x-5.x-dev and still received the TwitterException error, but hashtag converter works fine.
Installed version 7.x-5.8 and the patch worked, no TwitterException, but now I get the hashtag converter URL problem from Twitter #hashtag converter returns wrong address.
Edit:
Patch did NOT work on 7.x-5.x-dev for me, but DID work on the 7.x-5.8 production version.
Per discussion in #2018509: New Twitter API, I adjusted the Twitter settings and resolved the hashtag address issue.
Comment #10
tancPatch re-rolled with correct p1 format. Also confirmed this fixes the issue with tweets with very long titles now able to be posted.
Comment #11
marcoka commentedi also have this issue. my stuff is posted but i also get the error in the log.
Comment #12
dddave commentedHow about testing the patch then @ marcoka?
Comment #13
marcoka commentedlol i am am currently doing that :)
Comment #14
marcoka commentedreporting back. patch works here and fixes that error. thank you.
Comment #15
damienmckennaTriggering the testbot.
Comment #18
damienmckennaComment #19
damienmckenna#2548057: Add an AJAX preview of what the tweet would look like would help with this.
Comment #20
damienmckennaStrictly, speaking, the maximum length of a tweet that contains a URL is 117 with the tco URL holding the rest. This leads to this patch which truncates the string to 117 chars instead of 90.
Comment #21
damienmckennaPorted to the 6.x-5.x branch.
Comment #22
damienmckennaBecause the 7.x-6.x branch uses actual tokens, it'd be harder to limit those strings so just update the description for the status field.
Comment #27
damienmckennaI've committed the change to the 6.x-5.x and 7.x-5.x branches, but the 7.x-6.x patch is failing because of a testbot problem: #2548073: Testbot is checking out old version of Twitter 7.x-6.x branch
Comment #29
joelpittet@damienmckenna To make testbot smarten up I had to tag a new release (beta in my case for commerce discount)
https://www.drupal.org/node/2490991#comment-10159828
Comment #30
damienmckennaI've committed the 7.x-6.x change, will deal with testbot separately.
Comment #31
damienmckenna@joelpittet: Thanks for the tip, I'll take care of this soon.
Comment #32
marcoka commentedthank you drupal ninjas :)
Comment #34
Rob T commentedI seem to be experiencing this issue with 7.x-6.2 (Oct 5 2015), though I see Damien mention the commit to 7.x-6.x (comment #30, Aug 8 2015).
I have been documenting my observations in a different issue thread that initially suspected the error occurring when attempting to post duplicate messages (which I am not attempting), but my observatins are that the error occurs when the message length via my [node:title] is lengthier than the messages I am able to post to Twitter successfully.
https://www.drupal.org/node/2038155