Bugzilla – Attachment 112369 Details for
Bug 23916
Issuer should be recorded and visible in patron circulation history
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23916: (follow-up) Don't anonymise issuer and don't update action_logs on upgrade
Bug-23916-follow-up-Dont-anonymise-issuer-and-dont.patch (text/plain), 3.55 KB, created by
Nick Clemens (kidclamp)
on 2020-10-24 03:04:33 UTC
(
hide
)
Description:
Bug 23916: (follow-up) Don't anonymise issuer and don't update action_logs on upgrade
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-10-24 03:04:33 UTC
Size:
3.55 KB
patch
obsolete
>From eeb026f7de3379c06af36e79e8e24f3f2f04742d Mon Sep 17 00:00:00 2001 >From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >Date: Thu, 24 Sep 2020 13:55:55 +0100 >Subject: [PATCH] Bug 23916: (follow-up) Don't anonymise issuer and don't > update action_logs on upgrade > >This commit implements the two suggestions made by Nick in comment #41: > >- Removes the attempted retrospective addition of issuers to old issues. >It was not particularly reliable, it also is not appropriate if the user >does not wish to make use of this functionality > >- Removes the conversion of a NULL issuer to the anonymous borrowernumber when >anonymising checkouts >--- > Koha/Patrons.pm | 3 +- > .../atomicupdate/bug_23916_add_issues_issuer.perl | 32 ---------------------- > 2 files changed, 1 insertion(+), 34 deletions(-) > >diff --git a/Koha/Patrons.pm b/Koha/Patrons.pm >index b826c44101..a958200d1b 100644 >--- a/Koha/Patrons.pm >+++ b/Koha/Patrons.pm >@@ -196,8 +196,7 @@ sub anonymise_issue_history { > ); > my $anonymous_patron = C4::Context->preference('AnonymousPatron') || undef; > $nb_rows += $old_issues_to_anonymise->update( { >- 'old_issues.borrowernumber' => $anonymous_patron, >- 'old_issues.issuer' => $anonymous_patron >+ 'old_issues.borrowernumber' => $anonymous_patron > } ); > } > return $nb_rows; >diff --git a/installer/data/mysql/atomicupdate/bug_23916_add_issues_issuer.perl b/installer/data/mysql/atomicupdate/bug_23916_add_issues_issuer.perl >index 68df8a0447..589d3a91a8 100644 >--- a/installer/data/mysql/atomicupdate/bug_23916_add_issues_issuer.perl >+++ b/installer/data/mysql/atomicupdate/bug_23916_add_issues_issuer.perl >@@ -13,38 +13,6 @@ if( CheckVersion( $DBversion ) ) { > $dbh->do( q| ALTER TABLE old_issues ADD CONSTRAINT `old_issues_ibfk_borrowers_borrowernumber` FOREIGN KEY (`issuer`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE | ); > } > >- # Now attempt to migrate previously action logged issues into issues.issuer >- # We assume that an item issued to a borrower on the same day is the same issue >- # >- # Get existing action logs >- # - user = issuer >- # - object = borrowernumber >- # - info = itemnumber >- my $action_logs = $dbh->selectall_arrayref("SELECT DATE(timestamp) AS dt, user, object, info FROM action_logs WHERE module='CIRCULATION' and action='ISSUE'", { Slice => {} }); >- >- foreach my $log( @{$action_logs} ) { >- # Look for an issue of this item, to this borrower, on this day >- # We're doing DATE comparison in the database to avoid invoking >- # DateTime and it's performance sapping ways... >- # >- # If we're dealing with an actual borrower >- if ($log->{user} != 0) { >- my $done_issue = $dbh->do( >- "UPDATE issues SET issuer = ? WHERE DATE(timestamp) = ? AND borrowernumber = ? AND itemnumber = ?", >- undef, >- ( $log->{user}, $log->{dt}, $log->{object}, $log->{info} ) >- ); >- # If we didn't find the issue in 'issues', look in 'old_issues' >- if (!$done_issue) { >- $dbh->do( >- "UPDATE old_issues SET issuer = ? WHERE DATE(timestamp) = ? AND borrowernumber = ? AND itemnumber = ?", >- undef, >- ( $log->{user}, $log->{dt}, $log->{object}, $log->{info} ) >- ); >- } >- } >- } >- > SetVersion( $DBversion ); > print "Upgrade to $DBversion done (Bug 23916 - Add issues.issuer)\n"; > } >-- >2.11.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 23916
:
94914
|
94915
|
94916
|
94917
|
94918
|
95503
|
95504
|
95505
|
95506
|
95507
|
95508
|
95509
|
97719
|
97720
|
97721
|
97722
|
97723
|
97724
|
98586
|
98587
|
98588
|
98589
|
98590
|
98591
|
98594
|
99886
|
99887
|
99888
|
99889
|
99890
|
99891
|
110649
|
110650
|
110651
|
110652
|
110653
|
110654
|
110655
|
111485
|
111486
|
111487
|
111488
|
111489
|
111490
|
111491
|
111492
|
111966
|
111967
|
111968
|
111969
|
111970
|
111971
|
111972
|
111973
|
111974
|
112248
|
112249
|
112250
|
112251
|
112252
|
112253
|
112254
|
112255
|
112256
|
112257
|
112363
|
112364
|
112365
|
112366
|
112367
|
112368
|
112369
|
112370
|
112371
|
112372
|
112373
|
113035
|
113036
|
113037
|
113038
|
113039
|
113040
|
113041
|
113042
|
113043
|
113044
|
113045
|
113316
|
113317
|
113318
|
113319
|
113320
|
113321
|
113322
|
113323
|
113324
|
113325
|
113326
|
113327
|
113367
|
113368
|
113369
|
113370
|
113371
|
113372
|
113373
|
113374
|
113375
|
113376
|
113377
|
113378
|
113379
|
113380
|
113381
|
113382
|
113396