Skip to content

Commit

Permalink
Merge pull request #5779 from openfoodfacts/sort-by-nothing
Browse files Browse the repository at this point in the history
sort_by=nothing option to remove the sort of product queries,
  • Loading branch information
stephanegigandet authored Sep 28, 2021
2 parents c316466 + db294f1 commit 5b70ae2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/ProductOpener/Display.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4817,7 +4817,8 @@ sub search_and_display_products($$$$$) {
or (($sort_by ne 'created_t') and ($sort_by ne 'last_modified_t') and ($sort_by ne 'last_modified_t_complete_first')
and ($sort_by ne 'scans_n') and ($sort_by ne 'unique_scans_n') and ($sort_by ne 'product_name')
and ($sort_by ne 'completeness') and ($sort_by ne 'popularity_key') and ($sort_by ne 'popularity')
and ($sort_by ne 'nutriscore_score') and ($sort_by ne 'nova_score') and ($sort_by ne 'ecoscore_score') )) {
and ($sort_by ne 'nutriscore_score') and ($sort_by ne 'nova_score') and ($sort_by ne 'ecoscore_score')
and ($sort_by ne 'nothing') )) {

if ((defined $options{product_type}) and ($options{product_type} eq "food")) {
$sort_by = 'popularity_key';
Expand All @@ -4827,7 +4828,7 @@ sub search_and_display_products($$$$$) {
}
}

if (defined $sort_by) {
if ((defined $sort_by) and ($sort_by ne "nothing")) {
my $order = 1;
my $sort_by_key = $sort_by;

Expand Down

0 comments on commit 5b70ae2

Please sign in to comment.