Bugzilla – Attachment 92068 Details for
Bug 23431
having Date of birth in PatronSelfModificationBorrowerUnwantedField causes DOB to be nullified
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23431: Don't nullify DOB if it's hidden by sysprefs
Bug-23431-Dont-nullify-DOB-if-its-hidden-by-syspre.patch (text/plain), 1.75 KB, created by
Martin Renvoize
on 2019-08-08 11:50:04 UTC
(
hide
)
Description:
Bug 23431: Don't nullify DOB if it's hidden by sysprefs
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2019-08-08 11:50:04 UTC
Size:
1.75 KB
patch
obsolete
>From b911cb8b47f7364539a942b0ce5cf8b08ec28b67 Mon Sep 17 00:00:00 2001 >From: Liz Rea <wizzyrea@gmail.com> >Date: Mon, 5 Aug 2019 22:39:37 +0000 >Subject: [PATCH] Bug 23431: Don't nullify DOB if it's hidden by sysprefs > >To test: > >Turn on OPACPatronDetails >put dateofbirth in PatronSelfModificationBorrowerUnwantedField >Have a patron with a set date of birth >Attempt any modification on that patron through the OPAC >The date of birth will be one of the fields changed for that borrower >when you check it in the staff intranet. > >Apply this patch, repeat the above. >Date of birth will not be one of the changed fields. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > opac/opac-memberentry.pl | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index db8a6acbef..11a7ae2ae4 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -481,13 +481,17 @@ sub ParseCgiForBorrower { > > sub DelUnchangedFields { > my ( $borrowernumber, %new_data ) = @_; >- >+ # get the mandatory fields so we can get the hidden fields >+ my $mandatory = GetMandatoryFields('edit'); > my $patron = Koha::Patrons->find( $borrowernumber ); > my $current_data = $patron->unblessed; >+ # get the hidden fields so we don't obliterate them should they have data patrons aren't allowed to modify >+ my $hidden_fields = GetHiddenFields($mandatory, 'edit'); >+ > > foreach my $key ( keys %new_data ) { >- if ( $current_data->{$key} eq $new_data{$key} ) { >- delete $new_data{$key}; >+ if ( ($current_data->{$key} eq $new_data{$key}) || $hidden_fields->{$key} ) { >+ delete $new_data{$key}; > } > } > >-- >2.20.1
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 23431
:
92021
|
92027
|
92033
| 92068