Bug 34617: Preserve calculated expiration dates if set to update on import whether column included or not

To test:
1 - Setup a csv with column headers:
    surname	firstname	branchcode	categorycode	cardnumber	dateenrolled
2 - add values
    Acosta	Edna	CPL	PT	23529001000463	02/01/2013
3 - Set PT catgeory enrollement period to a specific date in the future
4 - Import the file and overwrite patrons and update dateexpiration
5 - Check Edna, note her date is not correct
6 - Apply patch
7 - Repeat
8 - Expiration date is now set as expected

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ed2b395a10)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0cdabc65f0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2023-08-25 14:51:28 +00:00 committed by Matt Blenkinsop
parent 609a553932
commit 31e0e7a024
1 changed files with 2 additions and 1 deletions

View File

@ -279,7 +279,8 @@ sub import_patrons {
# FIXME : You cannot update a field with a perl-evaluated false value using the defaults.
# The password is always encrypted, skip it unless we are forcing overwrite!
next if $col eq 'password' && !$overwrite_passwords;
next if $col eq 'password' && !$overwrite_passwords;
next if $col eq 'dateexpiry' && $update_dateexpiry;
unless ( exists( $csvkeycol{$col} ) || $defaults->{$col} ) {
$borrower{$col} = $member->{$col} if ( $member->{$col} );