Bug 32168 - Editing date/datetime fields without the dateaccessioned.pl plugin can cause errors
Summary: Editing date/datetime fields without the dateaccessioned.pl plugin can cause ...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-10 16:08 UTC by Lucas Gass
Modified: 2023-02-07 23:50 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 32168: Add dateaccessioned.pl to 952 (datelastseen) for new installs (1.71 KB, patch)
2023-02-07 23:43 UTC, Lucas Gass
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass 2022-11-10 16:08:17 UTC
When editing items that are date or datetime formatted without the dateaccessioned cataloging plugin it is quite easy to cause an error. 

To recreate:
1. Make sure some 952 field with dates (datelastseen, dateaccessioned ) are visible in the editor but make sure the dateaccessiond plugin is turned off. 
2. Set the date format system preference to mm/dd/yyyy
3. Edit an item and attempt to edit one of the date fields to something in the correct dateformat, like 11/11/2018.
4. You get an error as Koha is expecting the SQL date type format of YYYY-MM-DD. 

I'm not sure how to best solve this. My first thought is that we should require the dateaccessioned.pl plugin on date fields. 

Or we could add a hint about format?
Comment 1 Katrin Fischer 2022-11-13 23:01:55 UTC
It looks like we already added dateaccessioned.pl to $w, so we could probably also add it to datelastseen? 

Just wondering, if that could cause problems with bug 31212

  925         - tagfield: "952"
  926           tagsubfield: "w"
  927           liblibrarian: "Price effective from"
  928           libopac: "Price effective from"
  929           repeatable: 0
  930           mandatory: 0
  931           kohafield: items.replacementpricedate
  932           tab: 10
  933           authorised_value: ""
  934           authtypecode: ""
  935           value_builder: dateaccessioned.pl
  936           isurl: 0
  937           hidden: 0
  938           frameworkcode: ""
  939           seealso: ""
  940           link: ""
  941           defaultvalue:
Comment 2 Lucas Gass 2023-02-07 23:43:39 UTC
Created attachment 146373 [details] [review]
Bug 32168: Add dateaccessioned.pl to 952 (datelastseen) for new installs
Comment 3 Lucas Gass 2023-02-07 23:48:51 UTC
> Just wondering, if that could cause problems with bug 31212

Yes, I am running into this problem while working on 31212.
Comment 4 Lucas Gass 2023-02-07 23:50:00 UTC
My patch enables dateaccessioned.pl by default with 952$r but should we also do the same for other date fields?