I had a problem using the fb_require_authorization function. If the user is not logged in to Facebook, there was no redirect to the Facebook authorization page.

I looked into the code and saw that the function called header('Location: ...) with a comment that drupal_goto is just for internal redirects. Since drupal_goto is also fine for external redirects I just replaced the header() call with drupal_goto(). Now it works for me.

I've attached a patch file. Can someone have a look at it and give some feedback if this is a better solution?

Since this is my first Drupal patch, please excuse any mistakes ;)

CommentFileSizeAuthor
fb-use_drupal_goto.diff399 byteskplanz

Comments

cs_shadow’s picture

Status: Active » Needs review

Patch looks good. I agree that using header('Location': ...) is not the desired way to achieve redirects. Since drupal_goto() works fine for both internal and external redirects, the change is good.

(@kplanz, whenever you submit a patch, remember to mark the issue status as 'Needs review'. This helps reviewers recognize that a particular patch needs to be reviewed and also triggers the test-bot to test the patch.)