How do I fix that? Thanks!

Comments

cameron tod’s picture

This sounds like you have duplicate URLs. Check through your url_alias table to see if you have existing URLs for the ones you are trying to generate.

greggles’s picture

Title: I'm getting trailing "-0" and "-1" after my urls » alert user when url is changed due to it not being unique
Component: Miscellaneous » User interface
Category: support » feature

That seems right to me, cam8001. Thanks for your help.

This has come up more than once so I think we should give people a little more feedback about why this happens.

I propose that when a url is found to not be unique the module will check to see if verbose is on and, if so, check to see if the user has the permission to see Pathauto messages. And, of so, displays a message to the user letting them know why the -1 or -2 or whatever was added to their URL.

Sound good?

sinmao’s picture

Yeah, an alert message would be nice.

For me, I have every url end in ".html"; with duplicate url's, they end up looking like this "url.html-1". If I can get them to be "url-1.html", then I would mind it so much. Can I do that with the current release? Thx.

greggles’s picture

Unfortunately that is not possible now. I can see how it would be nice, though, so I'll think about how it might be possible and hopefully come up with something (or someone else may, of course...).

sinmao’s picture

Cool. Thx for the replies.

greggles’s picture

Status: Active » Needs review
StatusFileSize
new1.41 KB

And here's a patch. The message shown to users is:

The automatically generated alias content/asdf conflicted with an existing alias. Alias changed to content/asdf-4.

greggles’s picture

Status: Needs review » Fixed

Committed to 5.x and HEAD.

sinmao’s picture

Cool, thx!

Sorry for my ignorance. Does it mean that I should apply the patch or should I re-install the module?

greggles’s picture

If you really want to have this feature installed on your site you could just use the 5.x-2.x-dev tarball available from the project homepage. In a few days or so I will create a 5.x-2.3 release of Pathauto which will basically be the same as the current 5.x-2.x-dev file. So, if you use it now you get a preview of the bugfixes and enhancements in that version.

The alternative is to apply the patch file to your current installation (which doesn't always work perfectly since the patch is for the tip of the development branch and may not apply to a previous release).

Anonymous’s picture

Status: Fixed » Closed (fixed)

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