warn users if they use + or " " (space) as separator
guix - February 14, 2008 - 01:15
| Project: | Pathauto |
| Version: | 5.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | greggles |
| Status: | closed |
Description
I chose + for the separator, and in pathauto I have this node pattern : [title-raw]
I submit the node and I'm redirected to /separator%20test so the + has been replaced with a space and urlencoded.
Now the strange part is that I guess this Drupal message : Created new alias separator+test for node/7
However when I go to my homepage for example, where I have published this node, the link for the node is /separator%20test.
I check the aliases in /admin/build/path and indeed they have space as separator instead of +.
And now the final surprise : I manually entered the URL /separator+test... it works ! :-)

#1
I can confirm this behavior.
By this I believe guix means manually entering the URL into the browser's address bar - NOT manually entering the URL alias at node edit, since that results in the +s being replaced with spaces.
Checking at the db level, if we use +s as the separator, they don't show up in the url_alias table. If we use something like ^ or =, they do show up (but they are url encoded when they show up in the address bar of the browser - though not in the links to the pages).
By the way, I tested in the 5.x-2.0 version, and using + as the separator behaves as one would expect - the +s appear in the address bar and in the links, though not in the database.
mlsamuelson
#2
Yes, that's it !
And the beginning of my issue report should have been of course : I create a node with the title separator test
#3
Changed the title of the issue which was confusing.
#4
emphasis obviously mine, but if the path module by itself displays the same problem then Pathauto can't do much more...
Here is a prior request about this http://drupal.org/node/140811
Which was fixed in http://drupal.org/node/191116
Basically, it seems that using pluses in the url is a bad idea. I think it might be a good idea to make a note of that somewhere like in the little text underneath the separator box.
#5
Thank you Greggles ! Indeed this appears to lie deeper than pathauto. I liked the idea of + as separators but as it's urlencoded to %20 in Drupal Core, and as there's no proven evidence that + is best than - for SEO, I'll just go with the -.
I suggest that more than warning users, pathauto should disallow the use of + as a separator, if there's an easy way to prevent this. It makes sense, as using + as separator doesn't and won't work !
#6
Ok - restated the title to fit with the new purpose.
#7
I'm not sure I want to do real form validation and block users from the space or +. I think a warning is best so that they can insist on doing it if they want.
#8
The patch worked fine and I like the addition of the wording.
Sounds like the best course of action to me. I didn't think to test/consider the behavior of the path module by itself. Smart.
(Still... working... on... thinking... like... a... computer....)
mlsamuelson
#9
Awesome - thanks for the review mlsamuelson!
I've now committed this to the branches that become Drupal5.x-2 and 6.x-1.x.
#10
and that...
#11
Automatically closed -- issue fixed for two weeks with no activity.