Skip to content

Commit

Permalink
chore: handle more sort_by clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
jeabakker committed May 23, 2022
1 parent 4e3842a commit 60d6a37
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions classes/ColdTrick/OpenSearch/SearchParams/Initialize.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ protected function initializeSorting(array $search_params = []) {
$property = elgg_extract('property', $clause);
$direction = elgg_extract('direction', $clause, 'desc');

if (!isset($property_type)) {
$property_type = in_array($property, \ElggEntity::PRIMARY_ATTR_NAMES) ? 'attribute' : 'metadata';
}

switch ($property_type) {
case 'attribute':
$this->addSort($property, [
Expand Down

0 comments on commit 60d6a37

Please sign in to comment.