Skip to content

Commit fdb6dfd

Browse files
committed
Merge branch 'hotfix/fix_select_dir_at_panel' into 'feature/2.3.0'
Fix direction at panel See merge request metamodels/attribute_select!107
2 parents 262943e + fdb1357 commit fdb6dfd

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/Attribute/MetaModelSelect.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,7 @@ public function getFilterOptions($idList, $usedOnly, &$arrCount = null)
672672

673673
$strDisplayValue = $this->getValueColumn();
674674
$strSortingValue = $this->getSortingColumn();
675+
$sortingDirection = $this->getSortDirection();
675676
$strCurrentLanguage = null;
676677

677678
$metaModel = $this->getSelectMetaModel();
@@ -702,7 +703,7 @@ public function getFilterOptions($idList, $usedOnly, &$arrCount = null)
702703
}
703704

704705
try {
705-
$objItems = $metaModel->findByFilter($filter, $strSortingValue);
706+
$objItems = $metaModel->findByFilter($filter, $strSortingValue, 0, 0, $sortingDirection);
706707
} finally {
707708
if (isset($previousLanguage) && $metaModel instanceof ITranslatedMetaModel) {
708709
$metaModel->selectLanguage($previousLanguage);

src/Attribute/Select.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,10 @@ public function getFilterOptions($idList, $usedOnly, &$arrCount = null)
235235
return [];
236236
}
237237

238-
$tableName = $this->getSelectSource();
239-
$idColumn = $this->getIdColumn();
240-
$strSortColumn = $this->getSortingColumn();
238+
$tableName = $this->getSelectSource();
239+
$idColumn = $this->getIdColumn();
240+
$strSortColumn = $this->getSortingColumn();
241+
$sortingDirection = $this->getSortDirection();
241242

242243
if (null !== $idList) {
243244
$builder = $this->connection->createQueryBuilder()
@@ -253,7 +254,7 @@ public function getFilterOptions($idList, $usedOnly, &$arrCount = null)
253254
->where('modelTable.id IN (:ids)')
254255
->setParameter('ids', $idList, ArrayParameterType::STRING)
255256
->addGroupBy('sourceTable.' . $idColumn)
256-
->addOrderBy('sourceTable.' . $strSortColumn);
257+
->addOrderBy('sourceTable.' . $strSortColumn, $sortingDirection);
257258

258259
if (false !== ($additionalWhere = $this->getAdditionalWhere())) {
259260
$builder->andWhere($additionalWhere);

0 commit comments

Comments
 (0)