Bugzilla – Attachment 130252 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.42 KB, created by
Martin Renvoize
on 2022-02-08 08:03:49 UTC
(
hide
)
Description:
Bug 29780: Add Koha::Old::Holds->anonymize
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2022-02-08 08:03:49 UTC
Size:
1.42 KB
patch
obsolete
>From ec9131de0630d2afe2a79f7d81f06fab69573efc 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> >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > 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.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 29780
:
128964
|
128965
|
128966
|
128978
|
128979
| 130252 |
130253