correctly use Character groups-group context for checking titles of Character groups and Quests (fixes #96)

This commit is contained in:
oliver 2015-05-12 10:39:50 +02:00
commit 9b05e7400e
4 changed files with 20 additions and 16 deletions

View file

@ -372,17 +372,19 @@
/**
* Check if a Character group name already exists.
*
* @param string $name Name to check
* @param int $groupsgroupId Do not check this ID (for editing)
* @return boolean Whether name exists or not
* @param int $groupsgroupId ID of Character groups-group
* @param string $name Name to check
* @param int $groupId Do not check this ID (for editing)
* @return boolean Whether name exists or not
*/
public function characterGroupNameExists($name, $groupId=null)
public function characterGroupNameExists($groupsgroupId, $name, $groupId=null)
{
$data = $this->db->query(
'SELECT id '.
'FROM charactergroups '.
'WHERE name = ? OR url = ?',
'ss',
'WHERE charactergroupsgroup_id = ? AND (name = ? OR url = ?)',
'iss',
$groupsgroupId,
$name,
\nre\core\Linker::createLinkParam($name)
);