apeisa / UserGroups

Adds users groups and page based permission to ProcessWire
GNU General Public License v2.0
11 stars 4 forks source link

Making group titles unique #34

Closed teppokoivula closed 9 years ago

teppokoivula commented 9 years ago

We've had some issues with "identical group names", which turned out to be because title is generally used as the "visible name" of the group. In this context two identical titles shouldn't, in my opinion, be allowed at all.

I've solved this by hooking into saveReady and making sure the title is unique among groups siblings. This has been pushed as new branch feature-unique-group-titles, with all changes in one commit: d2756f5d949113c1dc29d3a5ad59cbd1e9b7eb58.

Would really appreciate some comments before merging to master!

/cc @apeisa @niklaka

apeisa commented 9 years ago

Looks good to me. Out of interest, was your duplicates because of some integration or just user mistake/confusion?

teppokoivula commented 9 years ago

User confusion, as far as I can tell -- I was just notified that there are groups with duplicate names causing issues, and went from there. Admittedly identical titles should be a rare thing to happen, but it's still better to prevent it altogether.

teppokoivula commented 9 years ago

I've just merged aforementioned changes to master -- see #35 for details. Closing this issue.