Bugzilla – Attachment 84646 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: (follow-up) Default value for dates
Bug-21610-follow-up-Default-value-for-dates.patch (text/plain), 1.21 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-02-01 19:22:38 UTC
(
hide
)
Description:
Bug 21610: (follow-up) Default value for dates
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-02-01 19:22:38 UTC
Size:
1.21 KB
patch
obsolete
>From bb4a349a2608add08bbee8cf450034e201310684 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 19 Oct 2018 12:14:20 +0200 >Subject: [PATCH] Bug 21610: (follow-up) Default value for dates > >We have some dates with DEFAULT CURRENT_TIMESTAMP and some dates with >default and UPDATE clause. > >Test plan: >Run Object.t again. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Object.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/Koha/Object.pm b/Koha/Object.pm >index d388eadbdf..7ef2296789 100644 >--- a/Koha/Object.pm >+++ b/Koha/Object.pm >@@ -141,7 +141,9 @@ 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) >- $self->$col(undef) unless $self->$col; >+ # 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}; > } > } > >-- >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