Bugzilla – Attachment 14826 Details for
Bug 9484
userid not generated consistently (different editing pages)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
0001-Bug-9484-userid-not-generated-consistently-different.patch (text/plain), 1.94 KB, created by
Adrien SAURAT
on 2013-01-24 16:14:07 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Adrien SAURAT
Created:
2013-01-24 16:14:07 UTC
Size:
1.94 KB
patch
obsolete
>From b3dd17ea804514e63a2bd6d0f74d884c3ee955e7 Mon Sep 17 00:00:00 2001 >From: Adrien Saurat <adrien.saurat@biblibre.com> >Date: Thu, 24 Jan 2013 17:11:31 +0100 >Subject: [PATCH] Bug 9484: userid not generated consistently (different > editing pages) > >When modifying a patron through different pages, the userid >generation does not behave always the same way; this patch >corrects this: >- when firstname and surname are present in the form, they >are used for the generation; >- if there are not in the form, the firstname and surname >in database are used instead. >--- > members/memberentry.pl | 13 ++++++++++++- > 1 files changed, 12 insertions(+), 1 deletions(-) > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index d2302dc..96e1f60 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -254,7 +254,18 @@ $newdata{'country'} = $input->param('country') if defined($input->param('country > > #builds default userid > if ( (defined $newdata{'userid'}) && ($newdata{'userid'} eq '')){ >- $newdata{'userid'} = Generate_Userid($borrowernumber, $newdata{'firstname'}, $newdata{'surname'}); >+ 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'} ); >+ } >+ elsif ( ( defined $data{'firstname'} ) && ( defined $data{'surname'} ) ) { >+ # Partial page edit (access through "Details"/"Library details" tab), firstname and surname input zones are not used >+ # Still, if the userid field is erased, we can create a new userid with available firstname and surname >+ $newdata{'userid'} = Generate_Userid( $borrowernumber, $data{'firstname'}, $data{'surname'} ); >+ } >+ else { >+ $newdata{'userid'} = $data{'userid'}; >+ } > } > > $debug and warn join "\t", map {"$_: $newdata{$_}"} qw(dateofbirth dateenrolled dateexpiry); >-- >1.7.5.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9484
:
14826
|
15426
|
16895