I've searched all over for examples of this, but I haven't found any. I'm trying to create an alias for path which includes query arguments, like profile?arg1=113.
It doesn't matter if I provide path_save()
with the plain string representation of the path, or if I provide it with url()
.
url('profile', array('query' => array('arg1' => $uid)))
Either way, ? and = show up as escaped characters on the URL aliases admin page, which naturally means the path can't be found.
How can I keep the ? and = from being escaped?
12/19/12 Edit 1: the larger context is that I'm trying to set up the alias when a Profile2 profile is being saved (i.e., in mymodule_profile2_presave()) - that's when I'll have all the information I need to programmatically set up the alias.
12/19/12 Edit 2: I just realized that the problem isn't on the insert side - the url_alias table actually has unescaped characters in it. The problem is that Drupal doesn't urldecode the path before using it...
12/20/12 Edit 3: Found a solution using Redirect instead of path aliases. Redirect properly decodes the query string!