Skip to content

Commit

Permalink
fix: remove warning in get_inherited_property_from_categories_tags (o…
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanegigandet authored and MonalikaPatnaik committed Jun 8, 2023
1 parent 8720115 commit b23bcbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ProductOpener/DataQualityFood.pm
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ sub check_nutrition_data_energy_computation ($product_ref) {
my $ignore_energy_calculated_error
= get_inherited_property_from_categories_tags($product_ref, "ignore_energy_calculated_error:en");

if (not($ignore_energy_calculated_error)) {
if (not((defined $ignore_energy_calculated_error) and ($ignore_energy_calculated_error eq 'yes'))) {
# Compare to specified energy value with a tolerance of 30% + an additiontal tolerance of 5
if ( ($computed_energy < ($specified_energy * 0.7 - 5))
or ($computed_energy > ($specified_energy * 1.3 + 5)))
Expand Down
2 changes: 1 addition & 1 deletion lib/ProductOpener/Tags.pm
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ sub get_inherited_property_from_categories_tags ($product_ref, $property) {
# Start with most specific category first
foreach my $category (reverse @{$product_ref->{categories_tags}}) {

$category_match = lc(get_inherited_property("categories", $category, $property));
$category_match = get_inherited_property("categories", $category, $property);
last if $category_match;
}
}
Expand Down

0 comments on commit b23bcbc

Please sign in to comment.