Bugzilla – Attachment 156149 Details for
Bug 34883
Regression in Patron Import dateexpiry function
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34883: Stop patron expiry date being set to NULL during import
Bug-34883-Stop-patron-expiry-date-being-set-to-NUL.patch (text/plain), 1.96 KB, created by
Matt Blenkinsop
on 2023-09-25 10:47:16 UTC
(
hide
)
Description:
Bug 34883: Stop patron expiry date being set to NULL during import
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2023-09-25 10:47:16 UTC
Size:
1.96 KB
patch
obsolete
>From 936d3305c393d3573655c3e503c759f16a2fe927 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Mon, 25 Sep 2023 10:34:18 +0000 >Subject: [PATCH] Bug 34883: Stop patron expiry date being set to NULL during > import > >A regression has been identified whereby an empty field in the dateexpiry field in a patron import file will cause the patron's expiry date to be set to NULL. This patch addresses this by checking for an empty field and using the existing expiry date if one is found. > >Test plan: >1) Setup a csv with column headers: > surname firstname branchcode categorycode cardnumber dateenrolled dateexpiry >2) Add values: > Acosta Edna CPL PT 23529001000463 02/01/2013 >3) Leave the dateexpiry column blank >4) Check Edna and make a note of her patron expiry date >5) Run the import_patrons.pl script with the following flags: > a) --file <filepath_for_your_csv_file> > b) --matchpoint cardnumber > c) --confirm > d) --overwrite >6) Check Edna, note her expiry date is now set to NULL >7) Manually edit Edna's expiry date to be reset to what it was before you ran the script >8) Apply the patch and restart_all >9) Repeat step 5 >10) Check Edna, this time her expiry date should be the same as the value you set it to in step 7 >11) Sign off! >--- > Koha/Patrons/Import.pm | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/Koha/Patrons/Import.pm b/Koha/Patrons/Import.pm >index 2e11a2ebb7..b1c751007e 100644 >--- a/Koha/Patrons/Import.pm >+++ b/Koha/Patrons/Import.pm >@@ -283,6 +283,8 @@ sub import_patrons { > next if $col eq 'password' && !$overwrite_passwords; > next if $col eq 'dateexpiry' && $update_dateexpiry; > >+ $borrower{$col} = $member->{$col} if $col eq 'dateexpiry' && !$columns[ $csvkeycol{$col} ]; >+ > unless ( exists( $csvkeycol{$col} ) || $defaults->{$col} ) { > $borrower{$col} = $member->{$col} if ( $member->{$col} ); > } >-- >2.37.1 (Apple Git-137.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 34883
:
156149
|
156196
|
156197
|
156368
|
156369
|
156370