Bugzilla – Attachment 45980 Details for
Bug 15332
ModMember not interpreting dates (Batch patron modification)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15332: Sent DateTime object to DBIx::Class, not formatted dates
Bug-15332-Sent-DateTime-object-to-DBIxClass-not-fo.patch (text/plain), 1.60 KB, created by
Marcel de Rooy
on 2015-12-24 10:32:14 UTC
(
hide
)
Description:
Bug 15332: Sent DateTime object to DBIx::Class, not formatted dates
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-12-24 10:32:14 UTC
Size:
1.60 KB
patch
obsolete
>From f787c1baaddffaccc30caac77f2c98b1cc23570a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 18 Dec 2015 15:01:15 +0000 >Subject: [PATCH] Bug 15332: Sent DateTime object to DBIx::Class, not > formatted dates >Content-Type: text/plain; charset=utf-8 > >If formatted dates are sent to DBIx::Class on update/insert, the date >will be set as 0000-00-00 (except if the format is yyyy-mm-dd). > >Test plan: >Use the batch patron modification tools to update the dateenrolled or >dateexpiry values for at least 1 patron. >Without this patch, the modified value will be updated to 0000-00-00, >with this patch, the correct value will be set. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > tools/modborrowers.pl | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/tools/modborrowers.pl b/tools/modborrowers.pl >index 4172bc3..71588c0 100755 >--- a/tools/modborrowers.pl >+++ b/tools/modborrowers.pl >@@ -35,6 +35,7 @@ use C4::Members::Attributes; > use C4::Members::AttributeTypes qw/GetAttributeTypes_hashref/; > use C4::Output; > use List::MoreUtils qw /any uniq/; >+use Koha::DateUtils qw( dt_from_string ); > use Koha::List::Patron; > > my $input = new CGI; >@@ -261,6 +262,10 @@ if ( $op eq 'do' ) { > $infos->{$field} = "" if grep { /^$field$/ } @disabled; > } > >+ for my $field ( qw( dateenrolled dateexpiry ) ) { >+ $infos->{$field} = dt_from_string($infos->{$field}); >+ } >+ > my @attributes = $input->param('patron_attributes'); > my @attr_values = $input->param('patron_attributes_value'); > >-- >1.7.10.4
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 15332
:
45839
|
45870
|
45980
|
46057