Closed (fixed)
Project:
Twitter
Version:
6.x-3.0-beta1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Feb 2010 at 22:51 UTC
Updated:
2 Mar 2010 at 01:00 UTC
The is re // $Id: twitter.pages.inc,v 1.4.2.7 2010/02/13 20:32:56 walkah Exp $
Twitter module installed with submodules Twitter Actions and Twitter Post (not Twitter Signin).
The "make global" option fails with an invalid path, /user/%252Fedit/twitter/global/. The correct path appears to be /user/#/edit/twitter/global/#, with the uid for the first pound and any number (or word) for the second (looks like it wants the twitter uid here). The function is in twitter.pages.inc starting on line 184.
function twitter_user_make_global($form_state, $account, $twitter_uid) {
module_load_include('inc', 'twitter');
$twitter_account = twitter_account_load($twitter_uid);
$form = array();
$form['uid'] = array(
'#type' => 'value',
'#value' => $account->uid,
);
$form['twitter_uid'] = array(
'#type' => 'value',
'#value' => $twitter_uid,
);
if ($twitter_account->is_global) {
$text = t('Are you sure you want to remove %screen_name from the global accounts?', array('%screen_name' => $twitter_account->screen_name));
$description = t('This means other users will no longer be allowed to post using this account.');
}
else {
$text = t('Are you sure you want to allow other users to access the %screen_name account?', array('%screen_name' => $twitter_account->screen_name));
$description = t('This will allow other users to post using this account.');
}
return confirm_form($form, $text, 'user/'. $account->uid .'/edit/twitter', $description);
}
function twitter_user_make_global_submit($form, &$form_state) {
db_query("UPDATE {twitter_account} SET is_global = (1 - is_global) WHERE twitter_uid = %d", $form_state['values']['twitter_uid']);
$form_state['redirect'] = 'user/'. $form_state['values']['uid'] .'/edit/twitter';
}
Comments
Comment #1
dilvish commentedLine 161 of twitter.pages.inc seems to be the problem. It's not resolving to the correct path due to two problems. First, it doesn't insert the current uid correctly (e.g., it should be /user/1/edit... but instead it's /user/%252Fedit/...), and second, it's not returning the twitter account uid, which is a different number such as 22289427.
Comment #2
walkah commentedwhoops! nice catch.. fix committed.
I'll roll a beta2 soon, gonna make sure any other bugs get fixed.
Thanks a lot!