Steps to reproduce: 1. Edit any item, change either the "d - Date acquired" or "w - Price effective from" to anything not-a-date (I like 24.99, due to mispasting Replacement price into Price effective from 2. Save the record Actual result: Invalid value passed, items.replacementpricedate=2 expected type is date at /usr/share/perl5/Exception/Class/Base.pm line 88 You can hit Back in the browser to go back and fix it, assuming you know what an items.replacementpricedate is or have an English speaker handy to tell you it's the Дата, для якої чинна ціна заміни. Expected result: Human readable message in a popup or in the page itself, giving the name of the field in the editor, rather than the name of the field in the database
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?
And look at us, we're doing comment 6 in bug 37398 *** This bug has been marked as a duplicate of bug 37398 ***