When adding a new twitter account that is not protected the saved account always have the private (protected) option set.
The patch from #509034: Protected Accounts Are Not Marked Protected already committed on July 4, 2009 doesn't solve that problem completely.
The twitter_fetch_account_info() function gathers information from Twitter and returns the xml data converted into an array.
But there are cases where the value should be a boolean. (http://twitterapi.pbworks.com/Return-Values)
That is the definition for
protected
Description: boolean indicating if a user has a protected profile
Examples: true, false
The issue is that the $results array returned for this is:
protected (String, 5 characters ) false
but in twitter_add_account_submit() the testing is wrong (twitter.pages.inc)
$account = twitter_fetch_account_info($form_state['values']['screen_name'], $form_state['values']['password']);
if ($account['protected']) {
$form_state['values']['protected'] = TRUE;
}
It always returns the account information as protected. In others parts of the module assumes that protected is a boolean, creating side problems.
I have added a clean up function for the booleans values to convert them into a boolean instead a string but this is done in the xml conversion to array functions.
Other problem when you are adding a new account is that the input validation is wrong, first we need to check for a mandatory screen_name and later for a correct optional password.
And submit this values to the twitter_user_save() function.
| Comment | File | Size | Author |
|---|---|---|---|
| twitter_protected_accounts.patch | 2.92 KB | jcmarco |
Comments
Comment #1
steinmb commentedIs related to #509034: Protected Accounts Are Not Marked Protected and we need to reroll
Comment #2
davidneedhamNo reply.