refinery / refinerycms-blog

The very best blogging engine for Refinery CMS
http://refinerycms.com
304 stars 251 forks source link

Slug uniqueness isn't verified #435

Open Plaristote opened 9 years ago

Plaristote commented 9 years ago

Greetings !

Recently one of our user had an issue while creating an article: it's a silly use case, because the user wanted to write two different articles with the same title.

Of course, this isn't possible, since the titles' uniquenesses are validated. But our user had a cunning idea: he added a point at the end of one of the title. That's when the problem appeared: we ended up with two different articles sharing the same slug... and the most recent being recorded as a draft.

As a consequence, when the users try to open the first article, they end up with a 404 error (because the first article found with this slug is a draft).

My question is: shouldn't the slugs be validated for uniqueness ? Is it already supposed to be the case ?

parndt commented 9 years ago

That seems like it should be a bug.. however can you, for now, ask your user not to try to cheat the system while a solution is devised? :smile:

It might be as easy as adding a uniqueness validation for the slug column.

bricesanchez commented 9 years ago

@Plaristote Could you provide us a pull request ?