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.
Hi,
I found a bug with incorrect using of element "query" for drupal_goto function which makes redirect incorrect. Please check below:
Before
line 210: $dest = array('query' => 'destination=fbconnect/link');
Correct
line 210: $dest = array('query' => array('destination' =>'fbconnect/link'));
Maybe there is other places with such a issue.
Regards,
Vadim
Comment | File | Size | Author |
---|---|---|---|
#5 | Wrong_using_of_drupal_goto-issue-1874710-5.patch | 1.16 KB | rajeev_drupal |
#3 | Wrong_using_of_drupal_goto-issue-1874710-3.patch | 801 bytes | rajeev_drupal |
Comments
Comment #1
rajeev_drupal CreditAttribution: rajeev_drupal commentedWorking on this issue...
Comment #2
rajeev_drupal CreditAttribution: rajeev_drupal commentedStart creating patch...
Comment #3
rajeev_drupal CreditAttribution: rajeev_drupal commentedHere parameters were not properly passed to drupal_goto() function. Second argument should be array format
This is right format for drupal_goto() function
drupal_goto($path = '', array $options = array(), $http_response_code = 302);
$path: (optional) A Drupal path or a full URL, which will be passed to url() to compute the redirect for the URL.
$options: (optional) An associative array of additional URL options to pass to url().
$http_response_code: (optional) The HTTP status code to use for the redirection, defaults to 302. The valid values for 3xx redirection status codes are defined in RFC 2616 and the draft for .
Example of proper use of this:
drupal_goto("products", array('mynode' => $node->nid));
Please find attached patch for this:Wrong_using_of_drupal_goto-issue-1874710-3.patch
Comment #4
jcisio CreditAttribution: jcisio commentedPlease note that $dest is used twice: in url() and later in drupal_goto().
Comment #5
rajeev_drupal CreditAttribution: rajeev_drupal commentedFixed it...assigned 2 different variable to 2 different function .
Updated patch: Wrong_using_of_drupal_goto-issue-1874710-5.patch
Comment #6
rachit_gupta CreditAttribution: rachit_gupta commentedTesting this patch. Will report my findings soon.
Comment #7
rajeev_drupal CreditAttribution: rajeev_drupal commentedComment #8
rajeev_drupal CreditAttribution: rajeev_drupal commentedSomeone Please review this patch.
Thanks,
Rajeev
Comment #9
nidhi.badani CreditAttribution: nidhi.badani as a volunteer and commentedComment #10
nidhi.badani CreditAttribution: nidhi.badani as a volunteer and commentedApologies for keeping it so long with me, but could not create the perfect environment to test this issue.