Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When user denies access to a twitter account the user is redirected to oauth callback with a GET parameter denied, and since we are always expecting oauth_token in our implementation, and an empty oauth_token parameter throws errors.
Notice: Undefined index: oauth_token in twitter_oauth_callback() (line 346 of /var/www/html/chia.in/mtweets/sites/all/modules/custom/twitter/twitter.pages.inc).
Notice: Undefined index: oauth_token in twitter_oauth_callback_form() (line 357 of /var/www/html/chia.in/mtweets/sites/all/modules/custom/twitter/twitter.pages.inc).
Notice: Undefined index: oauth_token in twitter_oauth_callback_form() (line 360 of /var/www/html/chia.in/mtweets/sites/all/modules/custom/twitter/twitter.pages.inc).
Invalid OAuth token.
Notice: Undefined variable: response in TwitterOAuth->get_access_token() (line 367 of /var/www/html/chia.in/mtweets/sites/all/modules/custom/twitter/twitter.lib.php).
Notice: Undefined index: oauth_token in TwitterOAuth->get_access_token() (line 368 of /var/www/html/chia.in/mtweets/sites/all/modules/custom/twitter/twitter.lib.php).
Notice: Undefined index: oauth_token_secret in TwitterOAuth->get_access_token() (line 368 of /var/www/html/chia.in/mtweets/sites/all/modules/custom/twitter/twitter.lib.php).
Here is a patch to fix this.
Comment | File | Size | Author |
---|---|---|---|
#3 | 1397634-3-twitter-connection_denied_notice.patch | 990 bytes | pfrenssen |
twitter-oauth-callback-access-denied.patch | 640 bytes | chia | |
Comments
Comment #1
steinmb CreditAttribution: steinmb commentedIs this issue related to #1363044: Callback URL Error ? The patch looks fine though we prob. need to polish the English error message.
Comment #2
Josephnewyork CreditAttribution: Josephnewyork commentedThis needs to be pushed. Here is mine:
Comment #3
pfrenssenI combined the patches from chia and Joe Weitzel, rerolled to the latest dev and added some small improvements.
Comment #4
juampynr CreditAttribution: juampynr commentedOutstanding work here guys. Many thanks. This has been committed.
http://drupalcode.org/project/twitter.git/commitdiff/741521a
Comment #6
xurizaemonCommitting a slight improvement in ae75024 and 0a46516, so that if you're logged in and trying to associate a Twitter account, you are returned to user/%/edit/twitter instead of <front>.
Comment #8
rajiv.singh CreditAttribution: rajiv.singh commentedHi @xurizaemon ,
Which version has commits ae75024 and 0a46516 .
I am using 7.x-5.8 and can see following code