N°2746 - Fix search from shortcut

This commit is contained in:
Eric
2020-02-13 11:56:19 +01:00
parent 585135c6c7
commit ef3bdd63a4
3 changed files with 70 additions and 7 deletions

View File

@@ -1127,7 +1127,7 @@ class ScalarExpression extends UnaryExpression
{
$oValue = $oAttDef->GetExistingTagsFromString($oValue, true);
}
/** @var \ormTagSet $oValue */
/** @var \ormTagSet $sValue */
$aTags = $oValue->GetTags();
foreach($aTags as $oTag)
{
@@ -1146,6 +1146,38 @@ class ScalarExpression extends UnaryExpression
IssueLog::Error($e->getMessage());
}
break;
case ($oAttDef instanceof AttributeEnumSet):
try
{
if (!empty($this->GetValue()))
{
$aValues = array();
$sValue = $this->GetValue();
if (is_string($sValue))
{
$aTags = $oAttDef->FromStringToArray($sValue, ' ');
}
else
{
$aTags = array();
}
foreach($aTags as $sLabel => $sValue)
{
$aValue['label'] = $sLabel;
$aValue['value'] = $sValue;
$aValues[] = $aValue;
}
$aCriterion['values'] = $aValues;
}
else
{
$aCriterion['has_undefined'] = true;
}
} catch (Exception $e)
{
IssueLog::Error($e->getMessage());
}
break;
case $oAttDef->IsExternalKey():
try
{