Summary: | Flatpickr allows entering invalid dates (from cataloguing plugin dateaccessioned.pl) | ||
---|---|---|---|
Product: | Koha | Reporter: | Phil Ringnalda <phil> |
Component: | Cataloging | Assignee: | Bugs List <koha-bugs> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | jonathan.druart, lucas, m.de.rooy |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36488 |
||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: |
Description
Phil Ringnalda
2021-02-24 02:36:27 UTC
I haven't been able to replicate the problem on 21.05/master, but when you enter an invalid date there is no error at all now. The date widget only shows for $d Date acquired, but it would be nice if it showed for the other fields as well. Maybe we could detect the data type in the database or we could add an option to the frameworks to say "is a date". Instead when you open the record again, it shows as 0000-00-00. So there are still some changes needed to have a helpful error message. Current master as of today: Trying to save 24.99 does no longer work. Trying to save free text like 'test' does not work. An empty field results in date of today in record (no problem). But unfortunately I can still get 0000-00-00 into my records by entering 0000-00-00 into the date field. It is displayed by the date picker as 00-1-11-30 (meaning: November 30 of year -1 ??) but gets stored as 0000-00-00. Also note: I can also save 0000-01-01. Or 0001-01-01, 0002-02-01, etc. Years like 0001 are displayed in the date picker as 1901 ? (In reply to Marcel de Rooy from comment #2) > Current master as of today: > > Trying to save 24.99 does no longer work. > Trying to save free text like 'test' does not work. > > An empty field results in date of today in record (no problem). > > But unfortunately I can still get 0000-00-00 into my records by entering > 0000-00-00 into the date field. It is displayed by the date picker as > 00-1-11-30 (meaning: November 30 of year -1 ??) but gets stored as > 0000-00-00. > > Also note: I can also save 0000-01-01. Or 0001-01-01, 0002-02-01, etc. Years > like 0001 are displayed in the date picker as 1901 ? https://github.com/flatpickr/flatpickr/issues/1524 (In reply to Marcel de Rooy from comment #2) > But unfortunately I can still get 0000-00-00 into my records by entering > 0000-00-00 into the date field. It is displayed by the date picker as > 00-1-11-30 (meaning: November 30 of year -1 ??) but gets stored as > 0000-00-00. I don't recreate that, I am getting a 500 with Invalid value passed, dateaccessioned=00-1-11-30 expected type is date at /usr/share/perl5/Exception/Class/Base.pm line 88 (In reply to Jonathan Druart from comment #4) > I don't recreate that, I am getting a 500 with > > Invalid value passed, dateaccessioned=00-1-11-30 expected type is date at > /usr/share/perl5/Exception/Class/Base.pm line 88 Set sql mode to 0. Assuming that this still is the case for a regular install. What I filed this on, the case where you have a date field for items which doesn't use the dateaccessioned plugin, is unchanged. You can enter a non-date, and we throw an unhelpful error. "Flatpickr doesn't let you enter an invalid date unless you work really hard at it" only answers that issue if instead of making its use a default (that can be changed), only in new installs, we make item date fields the only bib framework fields where you cannot change the plugin used. Does Bug 33703 prevent you from being able to directly enter an invlaid date? |