Bugzilla – Attachment 81020 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.17 KB, created by
Kyle M Hall (khall)
on 2018-10-23 13:16:23 UTC
(
hide
)
Description:
Bug 21610: (follow-up) Default value for dates
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2018-10-23 13:16:23 UTC
Size:
1.17 KB
patch
obsolete
>From 3adaf466b7c93186b41da1483a8ebe640d996e81 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> >--- > Koha/Object.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/Koha/Object.pm b/Koha/Object.pm >index 71a4ba86ad..a74ae2d995 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.17.1 (Apple Git-112)
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