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:

  1. Install and enable Twitter module
  2. Add the oAuth keys to the Twitter configuration
  3. Add an authenticated account
  4. Try to add a non-authenticated account with a username that is entirely numeric, such as 1010
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nicrodgers’s picture

Here'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.

nicrodgers’s picture

Status: Active » Needs review
nicrodgers’s picture

Here's a patch for 7.x-5.8

DamienMcKenna’s picture

This 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?

DamienMcKenna’s picture

Status: Needs review » Needs work

Triggering the testbot.

DamienMcKenna’s picture

Status: Needs work » Needs review

Triggering the testbot.

nicrodgers’s picture

Looks like the test bot never tested this patch - can we get it reviewed and commited?

DamienMcKenna’s picture

Status: Needs review » Needs work

The last submitted patch, 3: twitter-numericusernames-2378081-02.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 3: twitter-numericusernames-2378081-02.patch, failed testing.

DamienMcKenna’s picture

FileSize
1 KB

This patch has the correct directory structure.

DamienMcKenna’s picture

Status: Needs work » Needs review
nicrodgers’s picture

Nice one, thanks Damien.

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed. Thanks.

DamienMcKenna’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.