[Koha-bugs] [Bug 29157] Cannot set date/date-time attributes to NULL

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Oct 13 23:00:03 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29157

--- Comment #16 from Joonas Kylmälä <joonas.kylmala at iki.fi> ---
Created attachment 126238
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=126238&action=edit
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 at theke.io>
Signed-off-by: David Nind <david at davidnind.com>
Signed-off-by: Eric Phetteplace <phette23 at gmail.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala at iki.fi>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list