Bugzilla – Attachment 124739 Details for
Bug 28935
No filtering on patron's data on member entry pages (OPAC, self registration, staff interface)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28935: Add logging to controller scripts
Bug-28935-Add-logging-to-controller-scripts.patch (text/plain), 3.30 KB, created by
Martin Renvoize (ashimema)
on 2021-09-10 08:53:15 UTC
(
hide
)
Description:
Bug 28935: Add logging to controller scripts
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-09-10 08:53:15 UTC
Size:
3.30 KB
patch
obsolete
>From b8bce0fb12c178d23258294b61c74edcc7b97083 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 3 Sep 2021 14:13:32 +0000 >Subject: [PATCH] Bug 28935: Add logging to controller scripts > >Logged at DEBUG level. > >Test plan: >Adjust your logging config, add forbidden field, check log. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > members/memberentry.pl | 5 ++++- > opac/opac-memberentry.pl | 10 +++++++--- > 2 files changed, 11 insertions(+), 4 deletions(-) > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 227792c13a..5942c73195 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -47,6 +47,7 @@ use Koha::Token; > use Email::Valid; > use Koha::SMS::Providers; > use Koha::Patron::Allowlist; >+use Koha::Logger; > > my $allowlist = Koha::Patron::Allowlist->new({ interface => 'staff' }); > $allowlist->load; >@@ -434,7 +435,9 @@ if ( defined $sms ) { > $newdata{smsalertnumber} = $sms; > } > >-my $blocked = $allowlist->apply({ input => \%newdata, verbose => 1 }); # TODO Should we log results in $blocked ? >+my $blocked = $allowlist->apply({ input => \%newdata, verbose => 1 }); >+Koha::Logger->get->debug( 'memberentry.pl: allowlist blocked fields: '. >+ ( join ', ', map { $_. '='. $blocked->{$_} } sort keys %$blocked ) ) if keys %$blocked; > > ### Error checks should happen before this line. > $nok = $nok || scalar(@errors); >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index e8e9688b19..1aa490f067 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -45,8 +45,8 @@ use Koha::Patron::Modifications; > use Koha::Patron::Categories; > use Koha::Token; > use Koha::AuthorisedValues; >- > use Koha::Patron::Allowlist; >+use Koha::Logger; > > my $allowlist = Koha::Patron::Allowlist->new; > $allowlist->load; >@@ -138,7 +138,9 @@ if ( $action eq 'create' ) { > > my @unwanted_fields = split( /\|/, C4::Context->preference('PatronSelfRegistrationBorrowerUnwantedField') || q|| ); > $allowlist->remove( @unwanted_fields ); >- my $blocked = $allowlist->apply({ input => \%borrower, verbose => 1 }); # TODO Log blocked data ? >+ my $blocked = $allowlist->apply({ input => \%borrower, verbose => 1 }); >+ Koha::Logger->get->debug( 'opac-memberentry.pl: allowlist blocked fields: '. >+ ( join ', ', map { $_. '='. $blocked->{$_} } sort keys %$blocked ) ) if keys %$blocked; > > my $cardnumber_error_code; > if ( !grep { $_ eq 'cardnumber' } @empty_mandatory_fields ) { >@@ -277,7 +279,9 @@ elsif ( $action eq 'update' ) { > my @unwanted_fields = split( /\|/, C4::Context->preference('PatronSelfModificationBorrowerUnwantedField') || q|| ); > $allowlist->remove( @unwanted_fields ); > $allowlist->add( 'borrowernumber' ); # added because inserted after ParseCgi call >- my $blocked = $allowlist->apply({ input => \%borrower, verbose => 1 }); # TODO Log blocked data ? >+ my $blocked = $allowlist->apply({ input => \%borrower, verbose => 1 }); >+ Koha::Logger->get->debug( 'opac-memberentry.pl: allowlist blocked fields: '. >+ ( join ', ', map { $_. '='. $blocked->{$_} } sort keys %$blocked ) ) if keys %$blocked; > > # Send back the data to the template > %borrower = ( %$borrower, %borrower ); >-- >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 28935
:
124326
|
124327
|
124350
|
124416
|
124418
|
124422
|
124425
|
124446
|
124447
|
124448
|
124449
|
124450
|
124461
|
124462
|
124499
|
124500
|
124501
|
124502
|
124503
|
124523
|
124524
|
124525
|
124526
|
124527
|
124528
|
124529
|
124530
|
124531
|
124532
|
124640
|
124641
|
124642
|
124643
|
124644
|
124645
|
124646
|
124647
|
124648
|
124649
|
124650
|
124730
|
124731
|
124732
|
124733
|
124734
|
124735
|
124736
|
124737
|
124738
|
124739
|
124740
|
124769
|
124784
|
124832
|
124833
|
124837
|
124838
|
124839
|
124840