Skip to content

Commit

Permalink
Merge pull request #83 from jiru/fix-attribute-sort
Browse files Browse the repository at this point in the history
Fix sorting by certain attributes
  • Loading branch information
collectiveaccess authored Jul 10, 2023
2 parents b2345bf + c518122 commit e79a3d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/lib/BaseFindEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ private function _sortByAttribute($t_table, string $hit_table, ?string $element_
FROM ca_attribute_values cav FORCE INDEX(i_sorting)
INNER JOIN {$attr_tmp_table} AS attr_tmp ON attr_tmp.attribute_id = cav.attribute_id
WHERE cav.element_id = ?
ORDER BY cav.value_sortable {$direction}
ORDER BY cav.{$attr_val_sort_field} {$direction}
{$limit_sql}";

$qr_sort = $this->db->query($sql, [$element_id]);
Expand Down Expand Up @@ -873,7 +873,7 @@ private function _sortByRelatedAttribute($t_table, $t_rel_table, string $hit_tab
INNER JOIN {$hit_table} AS ht ON ht.row_id = t.{$table_pk}
{$filter_join}
WHERE cav.element_id = ? {$filter_where}
ORDER BY cav.value_sortable {$direction}
ORDER BY cav.{$attr_val_sort_field} {$direction}
{$limit_sql}";
$qr_sort = $this->db->query($sql, [$element_id]);
$sort_keys = [];
Expand Down

0 comments on commit e79a3d6

Please sign in to comment.