mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°931: Fix integrity controls (reserved word)
This commit is contained in:
@@ -180,6 +180,26 @@ abstract class TagSetFieldData extends cmdbAbstractObject
|
||||
$this->m_aCheckIssues[] = Dict::Format('Core:TagSetFieldData:ErrorTagCodeSyntax', $iMaxLen);
|
||||
}
|
||||
|
||||
// Check that the code is not a MySQL stop word
|
||||
$sSQL = "SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DEFAULT_STOPWORD";
|
||||
try
|
||||
{
|
||||
$aResults = CMDBSource::QueryToArray($sSQL);
|
||||
} catch (MySQLException $e)
|
||||
{
|
||||
IssueLog::Warning($e->getMessage());
|
||||
$aResults = array();
|
||||
}
|
||||
|
||||
foreach($aResults as $aResult)
|
||||
{
|
||||
if ($aResult['value'] == $sTagCode)
|
||||
{
|
||||
$this->m_aCheckIssues[] = Dict::S('Core:TagSetFieldData:ErrorTagCodeReservedWord');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$sTagLabel = $this->Get('label');
|
||||
$sSepItem = MetaModel::GetConfig()->Get('tag_set_item_separator');
|
||||
if (empty($sTagLabel) || (strpos($sTagLabel, $sSepItem) !== false))
|
||||
|
||||
@@ -920,6 +920,7 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'Core:TagSetFieldData:ErrorDeleteUsedTag' => 'Used tags cannot be deleted',
|
||||
'Core:TagSetFieldData:ErrorDuplicateTagCodeOrLabel' => 'Tags codes or labels must be unique',
|
||||
'Core:TagSetFieldData:ErrorTagCodeSyntax' => 'Tags code should contain between 3 and %1$d alphanumeric characters',
|
||||
'Core:TagSetFieldData:ErrorTagCodeReservedWord' => 'The chosen tag code is a reserved word',
|
||||
'Core:TagSetFieldData:ErrorTagLabelSyntax' => 'Tags label should not contain \'%1$s\' nor be empty',
|
||||
'Core:TagSetFieldData:ErrorCodeUpdateNotAllowed' => 'Tags "Code" cannot be changed',
|
||||
'Core:TagSetFieldData:ErrorClassUpdateNotAllowed' => 'Tags "Object Class" cannot be changed',
|
||||
|
||||
@@ -771,6 +771,7 @@ Opérateurs :<br/>
|
||||
'Core:TagSetFieldData:ErrorDeleteUsedTag' => 'Impossible de supprimer une étiquette utilisée',
|
||||
'Core:TagSetFieldData:ErrorDuplicateTagCodeOrLabel' => 'Les codes et noms des étiquettes doivent être unique',
|
||||
'Core:TagSetFieldData:ErrorTagCodeSyntax' => 'Le code de l\'étiquette doit contenir entre 3 et %1$d caractères alphanumériques.',
|
||||
'Core:TagSetFieldData:ErrorTagCodeReservedWord' => 'Le code de l\'étiquette un mot réservé.',
|
||||
'Core:TagSetFieldData:ErrorTagLabelSyntax' => 'Le nom de l\'étiquette ne doit pas être vide ni contenir le caractère \'%1$s\'',
|
||||
'Core:TagSetFieldData:ErrorCodeUpdateNotAllowed' => 'Le code de l\'étiquette ne peut pas être changé',
|
||||
'Core:TagSetFieldData:ErrorClassUpdateNotAllowed' => 'La classe de l\'étiquette ne peut pas être changée',
|
||||
|
||||
Reference in New Issue
Block a user