Bugzilla – Attachment 128965 Details for
Bug 29780
Add Koha::Old::Holds->anonymize
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29780: Add Koha::Old::Holds->anonymize
Bug-29780-Add-KohaOldHolds-anonymize.patch (text/plain), 1.30 KB, created by
Tomás Cohen Arazi
on 2022-01-03 13:39:50 UTC
(
hide
)
Description:
Bug 29780: Add Koha::Old::Holds->anonymize
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2022-01-03 13:39:50 UTC
Size:
1.30 KB
patch
obsolete
>From 955e829aee28959291eb4bd5abd46dabb8bd78c3 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 3 Jan 2022 10:37:09 -0300 >Subject: [PATCH] Bug 29780: Add Koha::Old::Holds->anonymize > >This patch adds a handy method for anonymizing a Koha::Old::Holds >resultset. It is planned to be used on bug 29526. > >To test: >1. Apply this patches >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/Old/Holds.t >=> SUCCESS: Tests pass! >3. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Old/Holds.pm | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > >diff --git a/Koha/Old/Holds.pm b/Koha/Old/Holds.pm >index 415c4c9b7e..40bf2dcdf2 100644 >--- a/Koha/Old/Holds.pm >+++ b/Koha/Old/Holds.pm >@@ -34,11 +34,27 @@ This object represents a set of holds that have been filled or canceled > > =head1 API > >-=head2 Class Methods >+=head2 Class methods >+ >+=head3 anonymize >+ >+ $patron->old_holds->anonymize(); >+ >+Anonymize the given I<Koha::Old::Holds> resultset. > > =cut > >-=head3 type >+sub anonymize { >+ my ( $self, $params ) = @_; >+ >+ my $anonymous_id = C4::Context->preference('AnonymousPatron') || undef; >+ >+ return $self->update( { borrowernumber => $anonymous_id }, { no_triggers => 1 } ); >+} >+ >+=head2 Internal methods >+ >+=head3 _type > > =cut > >-- >2.32.0
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 29780
:
128964
|
128965
|
128966
|
128978
|
128979
|
130252
|
130253