I've come across what I think is a bug in the way menu item paths are handled if they contain special characters like &. This issue was originally discussed in the forums here.
Basically, if a relative path containing an '&' is specified, the '&' is converted to '%26' when it is displayed and the link does not work. If the same path is specified in its absolute form, the '&' is left unchanged and the link works. ('?' and '=' are left unchanged.)
I came across this while using the CiviCRM module and I'll give an example using its links. However a quick test suggests that this issue applies to any links regardless of module, so it's not CiviCRM specific.
So, if I have a menu item path containing the following relative path:
civicrm/contribute/transact?reset=1&id=1
it is output/displayed as:
http://site.com/civicrm/contribute/transact?reset=1%26id=1
If I modify the menu item to use the following absolute path (by adding the site and leaving the rest unchanged):
http://site.com/civicrm/contribute/transact?reset=1&id=1
it is output/displayed as:
http://site.com/civicrm/contribute/transact?reset=1&id=1
The relative link fails when you click on it, while the absolute link works correctly. This would seem to be a bug.
(I've done a quick check under D6.0-RC2 and this bug does not appear.)
Comments
Comment #1
SilenceEchoed commentedThis bug just kicked my butt for about an hour and a half - The site I'm working on is to replace one currently in the wild, so the DNS isn't set up the way it will be when I'm done. Being forced to use absolute paths rather than relative is brutal and is going to cost me a lot of manpower once we're ready to go live...
Comment #2
dshaw commentedIf you've got a lot of links like this then it will be annoying. If Drupal 6 isn't ready in time for you, you can always look at modifying the database directly. Not for the faint-hearted, but I imagine it would be a simple change using SQL on the menu table. Or we can hope someone comes up with a patch.
Comment #3
dpearcefl commentedConsidering the time elapsed between now and the last comment plus the fact that D5 is no longer supported, I am closing this ticket.