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 ! :-)

CommentFileSizeAuthor
#7 warn_about_spaces.patch1.12 KBgreggles

Comments

mlsamuelson’s picture

I can confirm this behavior.

And now the final surprise : I manually entered the URL /separator+test... it works ! :-)

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

guillaumeduveau’s picture

Title: separator + is replaced by space but URLs with + still work ! » separator + gets is replaced by space but URLs with + still work !

manually entering the URL into the browser's address bar

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

guillaumeduveau’s picture

Title: separator + gets is replaced by space but URLs with + still work ! » separator + is replaced by space but URLs with + still work !

Changed the title of the issue which was confusing.

greggles’s picture

Title: separator + gets is replaced by space but URLs with + still work ! » separator + is replaced by space but URLs with + still work !

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.

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.

guillaumeduveau’s picture

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 !

greggles’s picture

Title: separator + is replaced by space but URLs with + still work ! » warn users if they use + or " " (space) as separator
Version: 6.x-1.x-dev » 5.x-2.x-dev

Ok - restated the title to fit with the new purpose.

greggles’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new1.12 KB

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.

mlsamuelson’s picture

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

greggles’s picture

Status: Reviewed & tested by the community » Fixed

Awesome - thanks for the review mlsamuelson!

I've now committed this to the branches that become Drupal5.x-2 and 6.x-1.x.

greggles’s picture

Assigned: Unassigned » greggles

and that...

Anonymous’s picture

Status: Fixed » Closed (fixed)

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