Skip to content

Commit

Permalink
fix: contributor plus another facet (#9788)
Browse files Browse the repository at this point in the history
fixes #9782 and adds a test
  • Loading branch information
stephanegigandet authored Feb 14, 2024
1 parent 6af0d7a commit 075f9cc
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ProductOpener/Display.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4217,8 +4217,8 @@ HTML
# Add parameters corresponding to the tag filters so that they can be added to the query by add_params_to_query()

foreach my $tag_ref (@{$request_ref->{tags}}) {
if ($tagtype eq 'users') {
deep_set($request_ref, "body_json", "creator", $tagid);
if ($tag_ref->{tagtype} eq 'users') {
deep_set($request_ref, "body_json", "creator", $tag_ref->{tagid});
}
else {
my $field_name = $tag_ref->{tagtype} . "_tags";
Expand Down Expand Up @@ -4307,7 +4307,7 @@ HTML
return;
}

=head2 display_list_of_tags ( $request_ref, $query_ref )
=head2 list_all_request_params ( $request_ref, $query_ref )
Return an array of names of all request parameters.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"count" : 10,
"page" : 1,
"page_count" : 10,
"page_size" : 24,
"products" : [
{
"product_name" : "Apples - Organic - France"
},
{
"product_name" : "Apples - Organic - France, Belgium, Canada"
},
{
"product_name" : "Apples - Organic, Fair trade - France"
},
{
"product_name" : "Bananas - Organic - France - brand2"
},
{
"product_name" : "Bananas - Organic - Martinique - brand1"
},
{
"product_name" : "Carrots - Fair trade, Organic - France - brand1"
},
{
"product_name" : "Carrots - Organic - France - brand1, brand2"
},
{
"product_name" : "Chocolate - Organic, Café Label - Martinique"
},
{
"product_name" : "Chocolate - Organic, Fair trade - Martinique"
},
{
"product_name" : "Oranges - Organic - Spain - brand1, brand2, brand3"
}
],
"skip" : 0
}
8 changes: 8 additions & 0 deletions tests/integration/facets.t
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,14 @@ my $tests_ref = [
expected_status_code => 200,
sort_products_by => 'product_name',
},
# contributor + another facet
{
test_case => 'contributor-alice-label_organic',
method => 'GET',
path => '/contributor/alice/label/organic.json?fields=product_name',
expected_status_code => 200,
sort_products_by => 'product_name',
},
# accented facet value in German
{
test_case => 'de-accented-cafe-label',
Expand Down

0 comments on commit 075f9cc

Please sign in to comment.