Fix stupid error in dropdown option selection

This commit is contained in:
Chris 2018-10-17 23:19:11 +01:00
parent f565068db1
commit 5be6b08517

View File

@ -165,8 +165,8 @@ sub _build_ingredients {
# Which template to use depends on whether this is a separator # Which template to use depends on whether this is a separator
my $template = $ingred -> {"separator"} ? "new/separator.tem" : "new/ingredient.tem"; my $template = $ingred -> {"separator"} ? "new/separator.tem" : "new/ingredient.tem";
my $unitopts = $self -> {"template"} -> build_optionlist($units, $args -> {"units"}); my $unitopts = $self -> {"template"} -> build_optionlist($units, $ingred -> {"units"});
my $prepopts = $self -> {"template"} -> build_optionlist($preps, $args -> {"prep"}); my $prepopts = $self -> {"template"} -> build_optionlist($preps, $ingred -> {"prep"});
push(@ingreds, push(@ingreds,
$self -> {"template"} -> load_template($template, $self -> {"template"} -> load_template($template,
@ -343,7 +343,6 @@ sub _validate_ingredients {
}); });
$errors .= $self -> {"template"} -> load_template("error/error_item.tem", { "%(error)s" => $error }) $errors .= $self -> {"template"} -> load_template("error/error_item.tem", { "%(error)s" => $error })
if($error); if($error);
print STDERR "JSON:".$args -> {"ingdata"}."\n";
my $ingdata = eval { decode_json($args -> {"ingdata"}) }; my $ingdata = eval { decode_json($args -> {"ingdata"}) };
return $self -> {"template"} -> load_template("error/error_item.tem", { "%(error)s" => "{L_ERR_JSONFORMAT}: $@" }) return $self -> {"template"} -> load_template("error/error_item.tem", { "%(error)s" => "{L_ERR_JSONFORMAT}: $@" })
@ -356,7 +355,6 @@ sub _validate_ingredients {
$errors .= $self -> _validate_ingredient($args, $ingred); $errors .= $self -> _validate_ingredient($args, $ingred);
} }
} }
print STDERR "Out: ",Dumper($args -> {"ingredients"})."\n";
return $errors; return $errors;
} }