From 7e44bb803fa085abdbded2311325f0c442b17708 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Fri, 9 Mar 2018 15:49:27 +0200 Subject: [PATCH] Bug 20367: Avoid resetting userid when BorrowerUnwantedField contains userid To test: 1. In staff client, set your username to firstname 2. Add userid to BorrowerUnwantedField system preference 3. Go to your patron modification screen (memberentry.pl) and click Save 4. Observe you get kicked out into login screen, saying: Error: You do not have permission to access this page. Log in as a different user 5. Apply patch and restart plack 6. Set your username back to firstname 7. Repeat step 3 8. Observe you were not kicked out and your userid stays the same Signed-off-by: Brendan Gallagher Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens --- members/memberentry.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index 13793e71cf..77c8eaf01b 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -278,7 +278,7 @@ $newdata{'lang'} = $input->param('lang') if defined($input->param('lang')) # builds default userid # userid input text may be empty or missing because of syspref BorrowerUnwantedField -if ( ( defined $newdata{'userid'} && $newdata{'userid'} eq '' ) || $check_BorrowerUnwantedField =~ /userid/ ) { +if ( ( defined $newdata{'userid'} && $newdata{'userid'} eq '' ) || $check_BorrowerUnwantedField =~ /userid/ && !defined $data{'userid'} ) { if ( ( defined $newdata{'firstname'} ) && ( defined $newdata{'surname'} ) ) { # Full page edit, firstname and surname input zones are present $newdata{'userid'} = Generate_Userid( $borrowernumber, $newdata{'firstname'}, $newdata{'surname'} ); -- 2.39.5