[Bug 17512] New: Improve handling dates in C4::Items
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Bug ID: 17512 Summary: Improve handling dates in C4::Items Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Cataloging Assignee: gmcharlt@gmail.com Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl This is a follow-up on the internal server error on 0000-00-00 in the items column onloan. This patch deals with preventing to have such dates at all in the date fields of items. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |m.de.rooy@rijksmuseum.nl Depends on| |17502 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17502 [Bug 17502] Resolve internal server error on 0000-00-00 (with Plack) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 56920 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=56920&action=edit Bug 17512: Improve handling dates in C4::Items This is a follow-up on the internal server error on 0000-00-00 in the items column onloan. This patch deals with preventing to have such dates at all in the date fields of items. It is accomplished by: [1] Adding a (private) subroutine _mod_item_dates. It takes an item hash and replaces date values if needed. [2] AddItem and ModItem call _koha_new_item resp. koha_modify_item. In these routines a call to the new _mod_item_dates is inserted. [3] Although the routine is actually private, I have added some unit tests to Items.t. Test plan: [1] Add a new item. Fill a correct date in dateaccessioned and an invalid date in Price effective from (=replacementpricedate). [2] Verify that dateaccessioned is saved correctly and replacementpricedate is still null (does not contain 0000-00-00). [3] Edit the item again. Fill some text in dateaccessioned and put a correct date in replacementpricedate. Verify the results. [4] Run t/db_dependent/Items.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=17519 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Mika <mikasmith@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mikasmith@catalyst.net.nz Status|Needs Signoff |Failed QA --- Comment #2 from Mika <mikasmith@catalyst.net.nz> --- Passed step 4 of test plan, however invalid dates still show as 0000-00-00 rather than null when saved for both dateaccessioned and replacementpricedate. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Mika from comment #2)
Passed step 4 of test plan, however invalid dates still show as 0000-00-00 rather than null when saved for both dateaccessioned and replacementpricedate.
Thanks for testing ! I cannot reproduce your test results. If am entering e.g. some text "aa" in replacementpricedate, the date will become null in the record, and shows blank on the form. If you test under Plack, please make sure to restart Plack after applying the patches. Could that be a cause ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Bug 17512 depends on bug 17502, which changed state. Bug 17502 Summary: Resolve internal server error on 0000-00-00 (with Plack) https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17502 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |RESOLVED Resolution|--- |WORKSFORME -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #56920|0 |1 is obsolete| | --- Comment #4 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 59759 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59759&action=edit [SIGNED-OFF] Bug 17512: Improve handling dates in C4::Items This is a follow-up on the internal server error on 0000-00-00 in the items column onloan. This patch deals with preventing to have such dates at all in the date fields of items. It is accomplished by: [1] Adding a (private) subroutine _mod_item_dates. It takes an item hash and replaces date values if needed. [2] AddItem and ModItem call _koha_new_item resp. koha_modify_item. In these routines a call to the new _mod_item_dates is inserted. [3] Although the routine is actually private, I have added some unit tests to Items.t. Test plan: [1] Add a new item. Fill a correct date in dateaccessioned and an invalid date in Price effective from (=replacementpricedate). [2] Verify that dateaccessioned is saved correctly and replacementpricedate is still null (does not contain 0000-00-00). [3] Edit the item again. Fill some text in dateaccessioned and put a correct date in replacementpricedate. Verify the results. [4] Run t/db_dependent/Items.t Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Thanks Josef. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #59759|0 |1 is obsolete| | --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 59789 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59789&action=edit Bug 17512: Improve handling dates in C4::Items This is a follow-up on the internal server error on 0000-00-00 in the items column onloan. This patch deals with preventing to have such dates at all in the date fields of items. It is accomplished by: [1] Adding a (private) subroutine _mod_item_dates. It takes an item hash and replaces date values if needed. [2] AddItem and ModItem call _koha_new_item resp. koha_modify_item. In these routines a call to the new _mod_item_dates is inserted. [3] Although the routine is actually private, I have added some unit tests to Items.t. Test plan: [1] Add a new item. Fill a correct date in dateaccessioned and an invalid date in Price effective from (=replacementpricedate). [2] Verify that dateaccessioned is saved correctly and replacementpricedate is still null (does not contain 0000-00-00). [3] Edit the item again. Fill some text in dateaccessioned and put a correct date in replacementpricedate. Verify the results. [4] Run t/db_dependent/Items.t Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Passed QA |Pushed to Master --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Marcel! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Status|Pushed to Master |Pushed to Stable --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This patch has been pushed to 16.11.x and will be in 16.11.04. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #9 from Julian Maurice <julian.maurice@biblibre.com> --- Pushed to 3.22.x for 3.22.17 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #10 from Mason James <mtj@kohaaloha.com> --- Pushed to 16.05.x, for 16.05.10 release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17512 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|17502 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17502 [Bug 17502] Resolve internal server error on 0000-00-00 (with Plack) -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org