Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
API page: http://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_g...
Enter a descriptive title (above) relating to drupal_goto, then describe the problem you have found:
This function allows $path to be empty, but doesn't say what will happen if you do that. I *assume* you go to the front page...?
Comment | File | Size | Author |
---|---|---|---|
#9 | 1596598-9-drupal_goto-docs.patch | 2.55 KB | mr.baileys |
#5 | 1596598-5-drupal_goto-docs.patch | 2.28 KB | mr.baileys |
#3 | 1596598-3-drupal_goto-docs.patch | 2.45 KB | mr.baileys |
Comments
Comment #1
joachim CreditAttribution: joachim commentedTagging.
Comment #2
jhodgdonIt looks like we should probably say on $path ", which will be passed to url() to compute the redirect for the URL.", and we should add something to url() that says that '' is equivalent to '<front>' (which you can tell from reading the code, but it should be in the documentation).
The reason I suggest this is that is that there is a lot of documentation already on url() that I don't think we want to duplicate. Better just to refer to reader there.
Comment #3
mr.baileysComment #4
jhodgdonThat looks really good! Tow small things I think should be fixed:
a)
This will end up reading as:
(link)...status codes: (endlink) Defaults to 302.
- list item
That isn't good. The : needs to be at the end of the line before the list, so the "Defaults to 302." should go somewhere else.
b)
passing -> passing in
Comment #5
mr.baileysCan't believe I missed the ':'+list. Would this work:
Comment #6
mr.baileysstatus change
Comment #7
jhodgdonThat looks perfect, thanks! I'll get it committed shortly.
Comment #8
jhodgdonCommitted to 8.x. The patch also applied to 7.x with a small amount of fuzz, so I committed it there too. Thanks!
I think we should probably backport it to 6.x as well, since I think it is all correct there (might be a good idea to verify this).
Comment #9
mr.baileysBack-ported to D6, verified that the logic is the same (i.e. passing NULL or '' to url is equivalent to pointing to the home page).
Comment #10
jhodgdonThat looks good for 6.x -- thanks!
Comment #11
jhodgdonI've been given permission to commit docs patches for Drupal 6, so this is in! Thanks again!