N°1381 - Search on string with index -> operator = (Fixed for derived classes)

SVN:trunk[5906]
This commit is contained in:
Eric Espié
2018-06-25 10:51:15 +00:00
parent 0449470cdf
commit 1e11ed3041

View File

@@ -329,7 +329,7 @@ class SearchForm
*/
protected function PopulateFieldList($sClass, $sAlias, &$aZList, &$aOthers)
{
$aDBIndexes = MetaModel::DBGetIndexes($sClass);
$aDBIndexes = self::DBGetIndexes($sClass);
$aIndexes = array();
foreach($aDBIndexes as $aIndexGroup)
{
@@ -381,6 +381,23 @@ class SearchForm
});
}
/**
* Search indexes for class and parents
* @param $sClass
*
* @return array
* @throws \CoreException
*/
protected static function DBGetIndexes($sClass)
{
$aDBIndexes = MetaModel::DBGetIndexes($sClass);
while ($sClass = MetaModel::GetParentClass($sClass))
{
$aDBIndexes = array_merge($aDBIndexes, MetaModel::DBGetIndexes($sClass));
}
return $aDBIndexes;
}
protected function IsSubAttribute($oAttDef)
{
return (($oAttDef instanceof AttributeFriendlyName) || ($oAttDef instanceof AttributeExternalField) || ($oAttDef instanceof AttributeSubItem));