From ad8f7576e03e3d0fb119a68a77d3ad83201301f2 Mon Sep 17 00:00:00 2001 From: Bruno Da Silva Date: Thu, 31 May 2018 07:41:03 +0000 Subject: [PATCH] =?UTF-8?q?N=C2=B01381=20Advanced=20search=20did=20not=20c?= =?UTF-8?q?orrectly=20compute=20indexes=20for=20"other"=20list=20of=20fiel?= =?UTF-8?q?ds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SVN:trunk[5823] --- sources/application/search/searchform.class.inc.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sources/application/search/searchform.class.inc.php b/sources/application/search/searchform.class.inc.php index 22dcb80bb..c2b4ff284 100644 --- a/sources/application/search/searchform.class.inc.php +++ b/sources/application/search/searchform.class.inc.php @@ -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']);