If you try to add a non-authenticated account whose username is numeric, you get an error message and the following log in the watchdog:
exception 'TwitterException' with message 'Not Found' in /Volumes/www/d7/drupal-7.33/sites/all/modules/twitter/twitter.lib.php:152 Stack trace: #0 /Volumes/www/d7/drupal-7.33/sites/all/modules/twitter/twitter.lib.php(115): Twitter->request('https://api.twi...') #1 /Volumes/www/d7/drupal-7.33/sites/all/modules/twitter/twitter.lib.php(1256): Twitter->auth_request('https://api.twi...', Array, 'GET') #2 /Volumes/www/d7/drupal-7.33/sites/all/modules/twitter/twitter.lib.php(1121): Twitter->call('users/show', Array, 'GET') #3 /Volumes/www/d7/drupal-7.33/sites/all/modules/twitter/twitter.pages.inc(507): Twitter->users_show('1010', false) #4 /Volumes/www/d7/drupal-7.33/includes/form.inc(1513): twitter_non_auth_account_form_submit(Array, Array) #5 /Volumes/www/d7/drupal-7.33/includes/form.inc(903): form_execute_handlers('submit', Array, Array) #6 /Volumes/www/d7/drupal-7.33/includes/form.inc(385): drupal_process_form('twitter_non_aut...', Array, Array) #7 /Volumes/www/d7/drupal-7.33/includes/form.inc(130): drupal_build_form('twitter_non_aut...', Array) #8 /Volumes/www/d7/drupal-7.33/sites/all/modules/twitter/twitter.pages.inc(136): drupal_get_form('twitter_non_aut...') #9 [internal function]: twitter_user_settings() #10 /Volumes/www/d7/drupal-7.33/includes/menu.inc(517): call_user_func_array('twitter_user_se...', Array) #11 /Volumes/www/d7/drupal-7.33/index.php(21): menu_execute_active_handler() #12 {main}
This happens on the latest 7.x-6.x-dev version, as well as 7.x-5.8.
Steps to reproduce:
- Install and enable Twitter module
- Add the oAuth keys to the Twitter configuration
- Add an authenticated account
- Try to add a non-authenticated account with a username that is entirely numeric, such as 1010
Comment | File | Size | Author |
---|---|---|---|
#12 | twitter-n2378081-12.patch | 1 KB | DamienMcKenna |
Comments
Comment #1
nicrodgersHere's a patch that solves the issue for me for 7.x-6.x-dev
I've rewritten the user_show function to take screen_name as a parameter, rather than userid. All calls to this function appear to be supplying screen_name anyway, so the code that was checking to see whether the passed $id was numeric seems unnecessary.
Comment #2
nicrodgersComment #3
nicrodgersHere's a patch for 7.x-5.8
Comment #4
DamienMcKennaThis is a worthwhile change as the UX currently says "Twitter account name", not "Twitter account ID". The problem would be whether existing records should be updated?
Comment #5
DamienMcKennaTriggering the testbot.
Comment #6
DamienMcKennaTriggering the testbot.
Comment #7
nicrodgersLooks like the test bot never tested this patch - can we get it reviewed and commited?
Comment #8
DamienMcKennaWe need to fix #2402317: Fix the 7.x-5.x branch tests first.
Comment #12
DamienMcKennaThis patch has the correct directory structure.
Comment #13
DamienMcKennaComment #14
nicrodgersNice one, thanks Damien.
Comment #15
DamienMcKennaCommitted. Thanks.
Comment #18
DamienMcKenna