MyBB Community Forums

Full Version: Can create multiple usergroups with the same name
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'd consider this a bug so I'll post it here and see if it effects anyone else. I can create many user groups with the exact same group name. There should be some sort of check.
I'd agree in an ideal world it would check, but I think after the length of time it's been like this, I'd claim Common Law Feature for this one.

https://blog.codinghorror.com/new-programming-jargon/

Quote:A bug in the application that has existed so long that it is now part of the expected functionality, and user support is required to actually fix it.

The issue with things like this is that if any forums have actually made use of this (for whatever reason), changing it would mean they'd not be able to save those groups.
Obviously up to the development team regarding this one and what they want to do with it.
it should still probably be pushed and then decided via github, imho.
I think it is a feature Smile Personally I used this on one of my old board. Anyway it should be discussed properly
We could include something like this into the 'add' & 'edit' usergroup actions:

if ($mybb->input['title'])
{
	$groupcache = $cache->read('usergroups');
	if ($groupcache)
	{
		foreach ($groupcache as $key => $value)
		{
			$grouptitles[] = $value['title'];
		}

		if (in_array(trim($mybb->input['title']), $grouptitles))
		{
			$errors[] = $lang->error_title_already_exists;
		}
	}
}

Certainly with the matching language phrases. Wink
MyBB team, what do you think?
This would probably be useful in some edge case situations I don't see the need to remove it.
I added a new issue and a PR to reviewing it by dev team.
=> https://github.com/mybb/mybb/issues/2691
To add to Sven's comment, maybe send a warning asking for confirmation instead of an out-right error. Multiple groups with the same user title can create confusion and is most likely a mistake.
Pages: 1 2