Support for querystring and fragment in goto URL

ryan_courtnage - January 19, 2009 - 21:34
Project:Go - url redirects
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi,

The attached patch will make gotwo look for a querystring in the destination url. If it finds one, it'll properly pass it to drupal_goto. If no querystring is found, then it behaves normally.

One use-case is for passing querystring parameters used by google analytics. Ex:

Label: trackme
Destination: node/3?utm_source=direct&utm_medium=email&utm_campaign=supercampaign

This will result in:

<?php
drupal_goto
('node/3','utm_source=direct&utm_medium=email&utm_campaign=supercampaign');
?>

AttachmentSize
gotwo.module_querystring.patch760 bytes

#1

hass - August 18, 2009 - 21:02
Version:6.x-1.0» 6.x-1.x-dev
Category:task» feature request
Status:needs review» needs work

I would better use http://www.php.net/manual/en/function.parse-url.php for slitting (and re-glue) URLs. Also code style needs work to follow core rules.

#2

hass - August 20, 2009 - 22:45
Status:needs work» fixed

I will commit the attached patch.

AttachmentSize
gotwo_redirection_with_query_and_fragment-D6.patch 1.11 KB

#3

hass - August 22, 2009 - 00:38
Title:Support for querystring in goto URL» Support for querystring and fragment in goto URL

#4

System Message - September 5, 2009 - 00:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.