Bugzilla – Attachment 84647 Details for
Bug 21610
Koha::Object->store needs to handle incorrect values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21610: Improve default values for dates
Bug-21610-Improve-default-values-for-dates.patch (text/plain), 1.43 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-02-01 19:22:43 UTC
(
hide
)
Description:
Bug 21610: Improve default values for dates
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-02-01 19:22:43 UTC
Size:
1.43 KB
patch
obsolete
>From bf5aedcb017898d2ee3ca6b60c5c12371ac1f64d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 19 Oct 2018 08:22:20 -0300 >Subject: [PATCH] Bug 21610: Improve default values for dates > >This patch fixes failures on t/db_dependent/Koha/Patrons/Import.t >and keep t/Auth_with_shibboleth.t and t/db_dependent/Koha/Object.t green > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Object.pm | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > >diff --git a/Koha/Object.pm b/Koha/Object.pm >index 7ef2296789..1c382f26d3 100644 >--- a/Koha/Object.pm >+++ b/Koha/Object.pm >@@ -141,9 +141,13 @@ sub store { > } > elsif ( _date_or_datetime_column_type( $columns_info->{$col}->{data_type} ) ) { > # Set to null if an empty string (or == 0 but should not happen) >- # Skip a default value for dates LIKE CURRENT_TIMESTAMP >- # In DBIx represented as: default_value => \'now()' >- $self->$col(undef) unless $self->$col || $columns_info->{$col}->{default_value}; >+ if ( defined $self->$col and not $self->$col ) { >+ if ( $columns_info->{$col}->{is_nullable} ) { >+ $self->$col(undef); >+ } else { >+ $self->$col($columns_info->{$col}->{default_value}); >+ } >+ } > } > } > >-- >2.20.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 21610
:
80880
|
80881
|
80882
|
80906
|
80926
|
80927
|
81016
|
81017
|
81018
|
81019
|
81020
|
81021
|
84601
|
84602
|
84603
|
84604
|
84605
|
84606
|
84642
|
84643
|
84644
|
84645
|
84646
| 84647