]> git.koha-community.org Git - koha.git/commit
Bug 29157: Date and Datetime attributes cannot be set NULL
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 7 Oct 2021 18:28:40 +0000 (15:28 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Sat, 23 Oct 2021 01:45:59 +0000 (15:45 -1000)
commit7eb7f570da831149f1f5d13062aa7de747a4ae23
tree4895a0a33641759df3e18310736c9f64deda71d2
parentbe39cf3296e31a43e0c8d1774961f3842ba8abfe
Bug 29157: Date and Datetime attributes cannot be set NULL

This patch makes Koha::Object->attribute_from_api allow setting
attributes the undef value. The original implementation passed the value
directly to dt_from_string, which made the attribute be set the current
date.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t \
           t/db_dependent/api/v1/patrons.t
=> FAIL: Tests fail! Our code is buggy!
3. Apply this patch
4. Repeat 2
=> SUCCESS! Fix fixed this thing!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Eric Phetteplace <phette23@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 2b93696da19a8a155ee5230b245827c077f8e520)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Object.pm