diff --git a/src/Attribute/BaseSimple.php b/src/Attribute/BaseSimple.php index beb4f8721..595d238de 100644 --- a/src/Attribute/BaseSimple.php +++ b/src/Attribute/BaseSimple.php @@ -3,7 +3,7 @@ /** * This file is part of MetaModels/core. * - * (c) 2012-2019 The MetaModels team. + * (c) 2012-2021 The MetaModels team. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -18,7 +18,7 @@ * @author Sven Baumann * @author David Molineus * @author Marc Reimann - * @copyright 2012-2019 The MetaModels team. + * @copyright 2012-2021 The MetaModels team. * @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later * @filesource */ @@ -164,7 +164,7 @@ public function getFilterOptions($idList, $usedOnly, &$arrCount = null) ->from($this->getMetaModel()->getTableName()) ->where('id IN (:ids)') ->groupBy($strCol) - ->orderBy('FIELD(id, :ids)') + ->orderBy('MIN(FIELD(id, :ids))') ->setParameter('ids', $idList, Connection::PARAM_STR_ARRAY) ->execute(); } else {