From 98b6b33f6e499e728409dc8087bc459607da4d32 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 9 Feb 2015 13:32:50 -0300 Subject: [PATCH] Bug 13602: (QA followup) take advantage of the defined-or operator Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 381de54ed1f56f61f22a682147b67d3902f43604) Signed-off-by: Chris Cormack --- members/memberentry.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index 888e8a08ef..09e11ea736 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -328,9 +328,10 @@ if ($op eq 'save' || $op eq 'insert'){ } } } - # Check if the userid is unique. Userid might not always be present in the edited values list when editing certain sub-forms, so we need to dig for it a bit. - my $userid = $newdata{'userid'}; - $userid = $borrower_data->{userid} unless $userid; #Get the userid straight from the DB + # Check if the 'userid' is unique. 'userid' might not always be present in + # the edited values list when editing certain sub-forms. Get it straight + # from the DB if absent. + my $userid = $newdata{ userid } // $borrower_data->{ userid }; unless (Check_Userid($userid,$borrowernumber)) { push @errors, "ERROR_login_exist"; } -- 2.39.5