Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanegigandet committed Feb 17, 2019
1 parent 2d0e0e1 commit cea7e9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions cgi/product_multilingual.pl
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ ($$)
my $field = shift; # can be in %language_fields and suffixed by _[lc]

my $fieldtype = $field;
my $display_lc = undef;
my $display_lc = $lc;

if (($field =~ /^(.*?)_(..|new_lc)$/) and (defined $language_fields{$1})) {
$fieldtype = $1;
Expand Down Expand Up @@ -1367,6 +1367,7 @@ ($$$$$$)
elsif ($field eq 'ingredients_text') {

my $value = $product_ref->{"ingredients_text_" . ${display_lc}};
not defined $value and $value = "";
my $id = "ingredients_text_" . ${display_lc};

$html_content_tab .= <<HTML
Expand Down Expand Up @@ -1524,8 +1525,8 @@ ($$$$$$)
$product_ref->{nutrition_data_prepared} = "";
}

my %column_display_style = {};
my %nutrition_data_per_display_style = {};
my %column_display_style = ();
my %nutrition_data_per_display_style = ();

# keep existing field ids for the product as sold, and append _prepared_product for the product after it has been prepared
foreach my $product_type ("", "_prepared") {
Expand Down
6 changes: 3 additions & 3 deletions lib/ProductOpener/Display.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6050,7 +6050,7 @@ sub display_field($$) {
}
if ($value ne '') {
if ((defined $value) and ($value ne '')) {
if (($field eq 'link') and ($value =~ /^http/)) {
my $link = $value;
$link =~ s/"|<|>|'//g;
Expand Down Expand Up @@ -8037,7 +8037,7 @@ HTML
my $percent = $comparison_ref->{nutriments}{"${nid}_100g_%"};
if ((defined $percent) and ($percent ne '')) {
$percent = $perf->format($percent / 100.0);
if ($percent > 0) {
if ($percent !~ /^-/) {
$percent = "+" . $percent;
}
$value_unit = '<span class="compare_percent">' . $percent . '</span><span class="compare_value" style="display:none">' . $value_unit . '</span>';
Expand Down Expand Up @@ -8183,7 +8183,7 @@ HTML
}
}
if ($col eq '100g') {
if (($col eq '100g') and (defined $product_ref->{nutriments}{$nid . "_$col"})) {
my $property = $nid;
$property =~ s/-([a-z])/ucfirst($1)/eg;
$property .= "Per100g";
Expand Down

0 comments on commit cea7e9f

Please sign in to comment.