drupal_goto() does not take query string the way I expected.

A friend of mine contacted me about a problem he was having on his site. He was doing a lot of tests with login/logout and he had the login_security module enabled. This little module will ban users automatically if they enter the wrong password too many times.

My friend was getting redirected to a page not found when trying to login and he did not understand why. I looked into it and it took me some time to figure out that the problem was with the way drupal_goto() was being called.

The first parameter of drupal_goto() must a drupal path without any query string. But the author of login_security had passed the value being returned from drupal_get_destination(). The value was a query string format which caused the error.
I create an issue on drupal.org for my friend and the great drupal community figured out the proper way to fix it.

The query string for drupal_goto() is NOT the first parameter. Go read the API documentation :)

This sounds great that you

This sounds great that you actually figure it out what seems to be the problem. On my opinion Drupal people has one of a kind skills.

Way to go Christian

You Drupal guys are great! You really help each other especially on the community of Drupal users. I only have a little knowledge about it since I'm a newbie but I am hopefully to get in touch with great people like you.

P.S: what Drupal community site are you in Chris?

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • You may post PHP code. You should include <?php ?> tags.
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options