Bugzilla – Attachment 80844 Details for
Bug 21596
Handle default values when storing Koha::Patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21596: Handle empty string for date_renewed when storing a patron
Bug-21596-Handle-empty-string-for-daterenewed-when.patch (text/plain), 1.76 KB, created by
Martin Renvoize (ashimema)
on 2018-10-18 13:52:57 UTC
(
hide
)
Description:
Bug 21596: Handle empty string for date_renewed when storing a patron
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-10-18 13:52:57 UTC
Size:
1.76 KB
patch
obsolete
>From 090b738ea9de69166d2552f432d0554987e6995e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 17 Oct 2018 19:51:50 -0300 >Subject: [PATCH] Bug 21596: Handle empty string for date_renewed when storing > a patron > >Incorrect date value: '' for column 'date_renewed' > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Patron.pm | 1 + > Koha/Patrons/Import.pm | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index f9214a6eed..4c9f955a13 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -195,6 +195,7 @@ sub store { > # We don't want invalid dates in the db (mysql has a bad habit of inserting 0000-00-00) > $self->dateofbirth(undef) unless $self->dateofbirth; > $self->debarred(undef) unless $self->debarred; >+ $self->date_renewed(undef) unless $self->date_renewed; > > # Set default values if not set > $self->sms_provider_id(undef) unless $self->sms_provider_id; >diff --git a/Koha/Patrons/Import.pm b/Koha/Patrons/Import.pm >index 1adb32da5c..712c97882f 100644 >--- a/Koha/Patrons/Import.pm >+++ b/Koha/Patrons/Import.pm >@@ -513,7 +513,7 @@ be formatted to the chosen date format. Populates the correctly formatted date o > sub format_dates { > my ($self, $params) = @_; > >- foreach my $date_type (qw(dateofbirth dateenrolled dateexpiry)) { >+ foreach my $date_type (qw(dateofbirth dateenrolled dateexpiry date_renewed)) { > my $tempdate = $params->{borrower}->{$date_type} or next(); > my $formatted_date = eval { output_pref( { dt => dt_from_string( $tempdate ), dateonly => 1, dateformat => 'iso' } ); }; > >-- >2.19.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 21596
:
80804
|
80807
|
80808
|
80809
|
80810
|
80837
|
80838
|
80839
|
80840
| 80844 |
80845
|
80846
|
80847
|
81080
|
81160
|
81537