mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 01:28:47 +02:00
N°931: Fix Label protection for tags
This commit is contained in:
@@ -214,13 +214,14 @@ abstract class TagSetFieldData extends cmdbAbstractObject
|
||||
$sClassName = get_class($this);
|
||||
if (empty($id))
|
||||
{
|
||||
$oSearch = DBSearch::FromOQL("SELECT $sClassName WHERE (code = '$sTagCode' OR label = '$sTagLabel')");
|
||||
$oSearch = DBSearch::FromOQL("SELECT $sClassName WHERE (code = :tag_code OR label = :tag_label)");
|
||||
}
|
||||
else
|
||||
{
|
||||
$oSearch = DBSearch::FromOQL("SELECT $sClassName WHERE id != $id AND (code = '$sTagCode' OR label = '$sTagLabel')");
|
||||
$oSearch = DBSearch::FromOQL("SELECT $sClassName WHERE id != :id AND (code = :tag_code OR label = :tag_label)");
|
||||
}
|
||||
$oSet = new DBObjectSet($oSearch);
|
||||
$aArgs = array('id' => $id, 'tag_code' => $sTagCode, 'tag_label' => $sTagLabel);
|
||||
$oSet = new DBObjectSet($oSearch, array(), $aArgs);
|
||||
if ($oSet->CountExceeds(0))
|
||||
{
|
||||
$this->m_aCheckIssues[] = Dict::S('Core:TagSetFieldData:ErrorDuplicateTagCodeOrLabel');
|
||||
|
||||
Reference in New Issue
Block a user