Getting this fatal error when attempting to add a Twitter account. In file twitter/twitter.pages.inc on line 295.

Comments

ssm2017 Binder’s picture

i can confirm that
this is only if you are not adding a password

liquidcms’s picture

yup, i get this as well.. also when not adding a passwd - which from the description text suggests i shouldn't need if account isnt protected

liquidcms’s picture

took a look at fixing this but didn't get too far.. a bit more convoluted that i was hoping

akolahi’s picture

i can confirm i am having the same issue as well.

nirbhasa’s picture

me too...a temporary solution might be to make password required, it does mean that you limit the scope of the module to protected accounts but at least it works

nirbhasa’s picture

Version: 6.x-3.0-beta2 » 6.x-3.x-dev
danny englander’s picture

Same issue, I can confirm. Seems odd that this issue has been open for 10 months now without a fix.

jeffreyvddb’s picture

I've got the problem also...

Centroamerica.TV’s picture

Hi.

This seems to become a big club of
fellows with same experience here .. ;-).

Let me in, please ;-)

So for now there is EXCELLENT NEWS :

Read the wonderful manuals and these posts and it will work like a charm ;-)

Basically see and understand that You need to configure two ends:

(a) Your sites installations
(b) Your API at the Twitter API site.

Good luck :-))

danny englander’s picture

Basically see and understand that You need to configure two ends:

(a) Your sites installations
(b) Your API at the Twitter API site.

@Centroamerica.TV -- I'm not sure I understand your comment above within the context of this issue. :)

PixelClever’s picture

@Centroamerica.TV - Better not to give advice before you understand the problem. This is a php error caused by the submit function which is not correctly set up to deal with the absence of a value on a field that is optional. No amount of reading the manual will make this fatal php error / white screen any less of a bug.

Canadaka’s picture

I'm also having this problem on a fresh drupal install. If I do fill in the password field it doesn't authenticate. Hasn't Twitter removed normal authentication like this and requires OAuth now?

But we shouldn't need to enter any password if all we want this module to do is pull tweets.

danny englander’s picture

I noticed that the maintainer of this module has not weighed in on this issue and it's been open for almost a year now. I am willing to sponsor / donate as I really need to get this working. :) cheers

szb100’s picture

...subscribing.

dougvann’s picture

DO NOT use the newest release. go back to 6.x-2.6.
Once I reverted I was fine.

markabur’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
StatusFileSize
new1.25 KB

This is also a problem with 7.x-3.x-dev. Can't add a Twitter account without supplying a password.

Attached patch solves this by defining an action to take when no password is present -- the key is to call users_show() in this case, instead of verify_credentials(). (Both of these functions return a TwitterUser object) :

+  else {
+    $twitter = new Twitter($name);
+    $account = $twitter->users_show($name);
+    if (!$account) {
+      form_set_error("screen_name", t('Twitter authentication failed. Please check your account name and try again.'));
+    }
+    $form_state['twitter_account'] = $account;
+  }

The following change causes users_show to *not* use authentication. I'm not sure why this was set to TRUE before. It seems like verify_credentials() is the way to generate an authenticated TwitterUser, whereas users_show() would be used to generate a non-authenticated one.

-    $values = $this->call('users/show', $params, 'GET', TRUE);
+    $values = $this->call('users/show', $params, 'GET', FALSE);

And this last change ensures that we don't get an ugly database error when trying to add an invalid Twitter username.

+    if (!$values) {
+      return FALSE;
+    }
markabur’s picture

Status: Active » Needs review
techgirlgeek’s picture

Same issue, version 6.x-3.x-dev

barrett’s picture

I can confirm the patch in comment 16 works on my installation. Thanks much, markabur.

michaek’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev

This issue should remain with 6.x. If it's also a problem with 7.x, it deserves a separate issue - however, there is very little active work on the 7.x module at this time.

I'll take a look at this patch, but there really shouldn't be a password field any longer. There's either a username field, or a button to connect to Twitter to use OAuth.

juampynr’s picture

Status: Needs review » Closed (duplicate)

These errors were fixed for both Drupal 6 and Drupal 7 versions (#1192138: Error when adding/associating a Twitter account to a site account).

Please upgrade to the latest releases available at http://drupal.org/project/twitter

Remember that if you only want to list tweets from a Twitter account you do not need OAuth module.

Cheers