[Bug] Two posts or page with same slug: save button should be disabled to prevent error

When I try to create two posts or page that have same slug I got a warning says to change the slug. However the save/draft/publish button are not disabled. Submitting one of this will generate a database error.

Probably some lines of javascript will solve the bug

Francesco, I tried this with a blog entry and it works as there is code that double checks the slug and appends a unique hash at the end if they are the same:
Example: disk-queues-77CAF

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

On my blog works only if I have the slug lock icon closed. If the lock icon is opened it throws error.

Weird. How do I replicate. Can you put steps please. As the save code should detect duplication and update the slug automatically for you

  1. create a page with title “Test” permalink icon lock “opened”
  • permalink icon lock “opened”

  • click publish

  1. create an entry with title “Test”
  • permalink icon lock “opened”

  • ignore the warning message

  • click publish
    Got this error:

Application Execution ExceptionError Type: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException : 1062

Error Messages: Duplicate entry ‘Test’ for key ‘slug’

I’m on railo 4.1

Thanks for the test case Francesco. I was able to replicate it. I’ll enter a ticket and we’ll get it fixed.

Thanks!

I’m glad to help