I'd like to request that this be added to the twitter_signin module.

http://drupal.org/sandbox/iwhitcomb/1539648

Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xurizaemon’s picture

Status: Active » Needs work

Ian, this would be a good feature to add. Are you interested in turning this into a straight patch for twitter_signin rather than a separate module? If so would be nice to see it in 7.x-3.4

iwhitcomb’s picture

Sure, I can work on that

iwhitcomb’s picture

Status: Needs work » Needs review
FileSize
4.8 KB

This ought to do it

manarth’s picture

I noticed in theme_twitter_signin_button, you pull in the $user global, and check for a user uid. If you're only checking to see if the current visitor is an anoymous user, there's another function you can use: user_is_anonymous() (there's also a corresponding user_is_logged_in() function).

 function theme_twitter_signin_button() {
+  if (variable_get('twitter_signin_callback_behavior', 'default') != 'default' && user_is_anonymous() && _twitter_use_oauth()) {
+    $callback = (variable_get('twitter_signin_callback_behavior') == 'go_back') ? current_path() : variable_get('twitter_signin_callback_path');
+  }

Personally I find this a little more readable as a developer.

13rac1’s picture

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

I agree with #4, plus patch does not cleanly apply to 7.x-5.x.

$ git apply 1814724-twitter-twitter-signin-behavior.patch 
error: patch failed: twitter_signin/twitter_signin.module:182
error: twitter_signin/twitter_signin.module: patch does not apply
$ patch -p1 < 1814724-twitter-twitter-signin-behavior.patch 
patching file twitter_signin/twitter_signin.module
Hunk #1 succeeded at 69 (offset 4 lines).
Hunk #2 succeeded at 97 (offset 2 lines).
Hunk #3 FAILED at 196.
Hunk #4 FAILED at 226.
2 out of 4 hunks FAILED -- saving rejects to file twitter_signin/twitter_signin.module.rej
patching file twitter_signin/twitter_signin.pages.inc
13rac1’s picture

Status: Needs review » Needs work
iwhitcomb’s picture

Status: Needs work » Needs review
FileSize
4.77 KB

Originally this was for 7.x-3.4 here's the 7.x-5.x patch

DamienMcKenna’s picture

Issue summary: View changes
Status: Needs review » Needs work

Triggering the testbot.

DamienMcKenna’s picture

Status: Needs work » Needs review

Triggering the testbot.

The last submitted patch, 3: 1814724-twitter-twitter-signin-behavior.patch, failed testing.

DamienMcKenna’s picture

Status: Needs review » Needs work

The last submitted patch, 7: 1814724-twitter-twitter-signin-behavior.patch, failed testing.