Bugzilla – Attachment 165575 Details for
Bug 36508
Patron userid field can be overwritten by update_patron_categories when limiting by fines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36508: Refresh patron object when updating category
Bug-36508-Refresh-patron-object-when-updating-cate.patch (text/plain), 1.32 KB, created by
Owen Leonard
on 2024-04-25 16:39:43 UTC
(
hide
)
Description:
Bug 36508: Refresh patron object when updating category
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2024-04-25 16:39:43 UTC
Size:
1.32 KB
patch
obsolete
>From 76bf7aed7335f470f0f5a1b4d25393452d658707 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 3 Apr 2024 20:35:46 +0000 >Subject: [PATCH] Bug 36508: Refresh patron object when updating category > >To test: >1 - Find a ptron, I sued #45 in KTD, note their category >2 - Update them from one category to another using finesunder: > perl misc/cronjobs/update_patrons_category.pl -f ST -t S --finesunder=5.00 --where "me.borrowernumber=45" -v -c >3 - Check their modification log (I told you to enabled BorrowersLog, > right?) >4 - See many fields reported changed >5 - Apply patch >6 - Repeat, but change the to and from options > perl misc/cronjobs/update_patrons_category.pl -f S -t ST --finesunder=5.00 --where "me.borrowernumber=45" -v -c >7 - Note only one column changed in the logs >8 - Ask for unit tests > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > Koha/Patrons.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/Koha/Patrons.pm b/Koha/Patrons.pm >index 92d3918363a..eb895733128 100644 >--- a/Koha/Patrons.pm >+++ b/Koha/Patrons.pm >@@ -399,6 +399,7 @@ sub update_category_to { > my ( $self, $params ) = @_; > my $counter = 0; > while( my $patron = $self->next ) { >+ $patron->discard_changes; > $counter++; > $patron->categorycode($params->{category})->store(); > } >-- >2.30.2
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 36508
:
164391
|
165571
|
165572
|
165574
|
165575
|
165784
|
165785