Fixed default Flex Pages collection ordering to order by filesystem path

This commit is contained in:
Matias Griese
2021-03-05 16:03:28 +02:00
parent 2727f92a53
commit 807df2ac55
3 changed files with 3 additions and 2 deletions

View File

@@ -12,6 +12,7 @@
* Fixed missing method `translated()` in `Flex Pages`
* Fixed missing `Flex Pages` in site if multi-language support has been enabled
* Fixed Grav using blueprints and form fields from disabled plugins
* Fixed default Flex Pages collection ordering to order by filesystem path
# v1.7.7
## 02/23/2021

View File

@@ -176,7 +176,7 @@ config:
indexed: true
# Set default ordering of the pages
ordering:
key: ASC
storage_key: ASC
search:
# Search options
options:

View File

@@ -380,7 +380,7 @@ class FlexIndex extends ObjectIndex implements FlexCollectionInterface, FlexInde
// Handle primary key alias.
$keyField = $this->getFlexDirectory()->getStorage()->getKeyField();
if (isset($orderings[$keyField])) {
if ($keyField !== 'storage_key' && isset($orderings[$keyField])) {
$orderings['key'] = $orderings[$keyField];
unset($orderings[$keyField]);
}