N°1381 Advanced search did not correctly compute indexes for "other" list of fields

SVN:trunk[5823]
This commit is contained in:
Bruno Da Silva
2018-05-31 07:41:03 +00:00
parent e205d85728
commit ad8f7576e0

View File

@@ -354,11 +354,7 @@ class SearchForm
{
if (array_key_exists($sAttCode, $aAttributeDefs))
{
$bHasIndex = false;
if (isset($aIndexes[$sAttCode]))
{
$bHasIndex = true;
}
$bHasIndex = isset($aIndexes[$sAttCode]);
$oAttDef = $aAttributeDefs[$sAttCode];
$aZList = $this->AppendField($sClass, $sAlias, $sAttCode, $oAttDef, $aZList, $bHasIndex);
unset($aAttributeDefs[$sAttCode]);
@@ -372,8 +368,9 @@ class SearchForm
{
// Add friendlyname to the most popular
$sAttCode = 'friendlyname';
$bHasIndex = isset($aIndexes[$sAttCode]);
$oAttDef = $aAttributeDefs[$sAttCode];
$aZList = $this->AppendField($sClass, $sAlias, $sAttCode, $oAttDef, $aZList);
$aZList = $this->AppendField($sClass, $sAlias, $sAttCode, $oAttDef, $aZList, $bHasIndex);
unset($aAttributeDefs[$sAttCode]);
}
$aZList = $this->AppendId($sClass, $sAlias, $aZList);
@@ -385,7 +382,8 @@ class SearchForm
{
if ($this->IsSubAttribute($oAttDef)) continue;
$aOthers = $this->AppendField($sClass, $sAlias, $sAttCode, $oAttDef, $aOthers);
$bHasIndex = isset($aIndexes[$sAttCode]);
$aOthers = $this->AppendField($sClass, $sAlias, $sAttCode, $oAttDef, $aOthers, $bHasIndex);
}
uasort($aOthers, function ($aItem1, $aItem2) {
return strcmp($aItem1['label'], $aItem2['label']);