From d36902191a13501306a03fc0566eb83ca79ee0da Mon Sep 17 00:00:00 2001 From: Gerhard Jungwirth Date: Thu, 4 Jan 2018 15:35:03 +0100 Subject: [PATCH] TT#29617 automatically generate form exceptions for validation exceptions here means, the fields are not automatically changed to the format {field}{id} for form validation because a field named {field_id} is present in the form anyway. Change-Id: I64b8e3ca1864c2b3b2697a69f87cfba17683bd19 --- lib/NGCP/Panel/Role/API.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/NGCP/Panel/Role/API.pm b/lib/NGCP/Panel/Role/API.pm index 7e640bf89a..13bb6ea0aa 100644 --- a/lib/NGCP/Panel/Role/API.pm +++ b/lib/NGCP/Panel/Role/API.pm @@ -169,13 +169,11 @@ sub validate_form { my $resource = $params{resource}; my $form = $params{form}; my $run = $params{run} // 1; - my $exceptions = $params{exceptions} // []; my $form_params = $params{form_params} // {}; - if(!@$exceptions && $form->can('validation_exceptions')){ - $exceptions = $form->validation_exceptions; - } - push @{ $exceptions }, "external_id"; + my $exceptions = [ + grep {m/_id$/} map {"".$_->name} $form->fields + ]; my @normalized = ();