From 8cd3572eedaf0da3b01a2d7791e4a92f02c6ae09 Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Fri, 4 Aug 2017 11:42:56 +0200 Subject: [PATCH] TT#19855 fix numeric preference value cast to int * set it to undef if it is not positive int Change-Id: Iae4094db86124cc277e9e9fb38bb6334c219b95e --- lib/NGCP/Panel/Role/API/Subscribers.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/NGCP/Panel/Role/API/Subscribers.pm b/lib/NGCP/Panel/Role/API/Subscribers.pm index e4daf23937..f9b353db38 100644 --- a/lib/NGCP/Panel/Role/API/Subscribers.pm +++ b/lib/NGCP/Panel/Role/API/Subscribers.pm @@ -97,9 +97,11 @@ sub resource_from_item { my $pref = NGCP::Panel::Utils::Preferences::get_usr_preference_rs( c => $c, attribute => 'lock', prov_subscriber => $item->provisioning_voip_subscriber); - if($pref->first) { + if($pref->first && $pref->first->value && is_int($pref->first->value)) { #cast to Numeric accordingly to the form field type and customer note in the ticket #10313 $resource{lock} = 0 + $pref->first->value; + } else { + $resource{lock} = undef; } $resource{customer_id} = int(delete $resource{contract_id});