From c9e6ca1681877c44c83aaa9be38d6299e1939481 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 16 Sep 2018 11:33:11 +0100 Subject: [PATCH] Fix field names in validator code --- blocks/ORB/Common.pm | 76 +++++++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 32 deletions(-) diff --git a/blocks/ORB/Common.pm b/blocks/ORB/Common.pm index aed231f..2536302 100644 --- a/blocks/ORB/Common.pm +++ b/blocks/ORB/Common.pm @@ -304,13 +304,13 @@ sub _validate_ingredient { # Units and prep method are option lists, so check them ($ingredient -> {"units"}, $error) = $self -> _validate_ingredient_option($ingdata -> {"units"}, - "{L_NEW_UNITS}", + "{L_RECIPE_UNITS}", $self -> _get_units()); $errors .= $self -> {"template"} -> load_template("error/error_item.tem", { "%(error)s" => $error }) if($error); ($ingredient -> {"prep"}, $error) = $self -> _validate_ingredient_option($ingdata -> {"prep"}, - "{L_NEW_PREP}", + "{L_RECIPE_PREP}", $self -> _get_prepmethods()); $errors .= $self -> {"template"} -> load_template("error/error_item.tem", { "%(error)s" => $error }) if($error); @@ -335,7 +335,7 @@ sub _validate_ingredients { ($args -> {"ingdata"}, $error) = $self -> validate_string("ingdata", { required => 1, default => "", - nicename => "{L_NEW_INGREDIENTS}", + nicename => "{L_RECIPE_INGREDIENTS}", encode => 0, }); $errors .= $self -> {"template"} -> load_template("error/error_item.tem", { "%(error)s" => $error }) @@ -370,63 +370,75 @@ sub _validate_recipe { my $self = shift; my ($args, $error, $errors) = ( {}, "", "" ); - #