Skip to content

Commit 4cbe3e9

Browse files
authored
[Bug, EC] PEES-650: Fix classification-store editor grid sorting (#971)
* fix sorting * fix sorting by key that have a protected name
1 parent a411107 commit 4cbe3e9

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

public/js/pimcore/object/classificationstore/collectionsPanel.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ pimcore.object.classificationstore.collectionsPanel = Class.create({
9090
this.relationsStore = new Ext.data.Store({
9191
autoSync: true,
9292
proxy: proxy,
93+
remoteSort: true,
9394
fields: readerFields,
9495
listeners: listeners
9596
});

public/js/pimcore/object/classificationstore/groupsPanel.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ pimcore.object.classificationstore.groupsPanel = Class.create({
8989
this.relationsStore = new Ext.data.Store({
9090
autoSync: true,
9191
proxy: this.getRelationsProxy(),
92+
remoteSort: true,
9293
fields: readerFields,
9394
listeners: listeners
9495
});

src/Controller/Admin/DataObject/ClassificationstoreController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ public function collectionRelationsGetAction(Request $request): JsonResponse
523523
}
524524
$list->setOffset($start);
525525
$list->setOrder($order);
526-
$list->setOrderKey($orderKey);
526+
$list->setOrderKey($mapping[$orderKey] ?? $orderKey);
527527
$condition = '';
528528

529529
if ($request->get('filter')) {
@@ -764,7 +764,7 @@ public function relationsActionGet(Request $request): JsonResponse
764764
$sortingSettings = \Pimcore\Bundle\AdminBundle\Helper\QueryParams::extractSortingSettings($allParams);
765765

766766
if ($sortingSettings['orderKey'] && $sortingSettings['order']) {
767-
$orderKey = $sortingSettings['orderKey'];
767+
$orderKey = $mapping[$sortingSettings['orderKey']] ?? $sortingSettings['orderKey'];
768768
$order = $sortingSettings['order'];
769769
}
770770

0 commit comments

Comments
 (0)