Duplicate Friendly URL's

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
5/5/2009 3:47:43 PM
Gravatar
Total Posts 73

Duplicate Friendly URL's

  • Windows 2003
  • MSSQL
  • mojoportal-2-2-9-6

When entering a blog, if you select a title that already exists the code determines that the friendly url it is creating exists and prepends a 1 to the new friendly. This is fine, until the 3rd time a blog is entered with the same name. Then the 3rd blog also tries to prepend a 1 to the friendly url. If you then hit the save button, your new blog is lost. Steps to recreate:

Create blog with title "Test Foo" friendly url maps to "~/Test-Foo.aspx"

Create 2nd blog with title "Test Foo" friendly url maps to "~/1Test-Foo.aspx"

Create 3rd blog with title "Test Foo" friendly url maps to "~/1Test-Foo.aspx" Except when saving this blog it is lost.

Hopefully this would be a very rare occurence in the real world. If it did occur, I would have some very unhappy customers on my hands if they lose their work put into creating a blog.

 

5/5/2009 5:48:09 PM
Gravatar
Total Posts 73

Re: Duplicate Friendly URL's

Actually, I just thought of a suggestion for this, that would help eliminate duplicate urls. Would it be possible to sub-folder each blog? Example:

User1s blog : http//site/User1/pagename.aspx

User2s blog : http//site/User2/pagename.aspx

That way the pagenames would not collide.

5/6/2009 6:47:20 AM
Gravatar
Total Posts 18439

Re: Duplicate Friendly URL's

Hi,

Thanks for the bug report with steps to produce it. I will investigate this and fix it today.

I will add a web config setting that will allow forcing a prefix like username-post-title.aspx, the friendly urls are not designed to simulate folders.
Or perhaps appending the date to the end of the post title like post-title-2009-05-05-05-10-90.aspx would solve it more naturally.

The Web.config setting will be disabled by default because probably a lot of sites are not hosting a bunch of blogs and would rather not have the prefix in the url, but this will allow that scenario of lost of blogs and avoid url collisions.

Best,

Joe 

5/6/2009 9:26:49 AM
Gravatar
Total Posts 73

Re: Duplicate Friendly URL's

Thanks, that is great. :) Would it also be possible to not allow the save, and present them with a duplicate url error if in case they did hit a dupe?

5/6/2009 9:36:18 AM
Gravatar
Total Posts 18439

Re: Duplicate Friendly URL's

Hi,

I just tested this following your steps on the demo site and the behavior was not as you described so, possibly it was a bug in version 2.2.9.6 but not in the current version, though I don't recall any recent changes in the relevant code. 

If the url exists it continues to append 1s so the third post with the name Test Foo resulted in the url ~/11test-foo.aspx not ~/1test-foo.aspx (as you reported) and if I try to force it to use ~/1test-foo.aspx it does prevent me and warns that the url already exists. 

Best,

Joe

5/6/2009 12:09:24 PM
Gravatar
Total Posts 73

Re: Duplicate Friendly URL's

Nice. I will test it again, I could have been mistaken. I also was waiting on upgrading, as I just finished a demo on the current code base.

Thanks btw for the fast responses.

5/6/2009 12:46:31 PM
Gravatar
Total Posts 18439

Re: Duplicate Friendly URL's

Cool, btw, today I implemented the config option to append the date to blog urls to help avoid url collisions if different blogs have the same post title. So this option wil be in the next release and will be in svn trunk within a day or so. 

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.