[Koha-bugs] [Bug 23463] Move C4::Items CRUD subroutines to Koha::Item

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Mar 23 13:14:45 CET 2020


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

--- Comment #156 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
Created attachment 101432
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101432&action=edit
Bug 23463: Fix selenium tests (highlight a bug in date management)

There is something wrong, and a regression has been caught by those
tests:
If an invalid date is passed from the add item form, the app now
crashes.
Before:
 * if the date was completely invalid, the field was blanked
silently
 * DateTime::Format::MySQL was used to convert dates, and it's not
 strict at all. For instance, what happened in the selenium tests for
 dateaccessionned: %Y-%m-%d was prefilled by the framework plugin, then
 the biblionumber was added, we ended with something like (eg for today)
 2020-03-234242 (with biblionumber=4242). DateTime::Format::MySQL
 converts that to 2020-03-23

We must deal with invalid dates, but I do not think it is good to add it
back to Koha::Item->store, we will prefer to raise the error to the end
user, saying that something went wrong (and more specifically the
dates).

The (ugly) trick was in C4::Items::_mod_item_dates

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


More information about the Koha-bugs mailing list