[Bug 29958] New: Dateaccessioned is set to todays date if missing when storing an item.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Bug ID: 29958 Summary: Dateaccessioned is set to todays date if missing when storing an item. Change sponsored?: --- Product: Koha Version: 20.05 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: andreas.jonsson@kreablo.se QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl In the work on bug 23463 the subroutine _set_defaults_for_add was removed in commit 02134d7604a6fc08b88046fde87b6c909de04353. This subroutine was called when a new item was added (in subroutines AddItem and AddItemBatchFromMarc). However, commit 02134d7604a6fc08b88046fde87b6c909de04353 adds this to the store method of Koha::Item : + unless ( $self->dateaccessioned ) { + $self->dateaccessioned($today); + } + I'm guessing this migth have been a mistake, and it should have been added to the new method? The problem here is that libraries that have old items with dateaccessioned NULL will gradually get their database filled with garbage dateaccessioned as the date gets updated whenever the item is issued and therefore will be unable to rely on the accuracy of dateaccessioned. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- ... and it will show up in new acquisition lists etc. Not good. :( Koha always enforced the dateaccessioned, so it can only be empty as a result of data manipulation or migrations. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Ola Andersson <ola.andersson@ltu.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ola.andersson@ltu.se -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Dateaccessioned is set to |Missing dateaccessioned is |todays date if missing when |set to today when storing |storing an item. |an item -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Did you see: 29815 Koha Serials alexbuckley@catalyst.net.nz Push --- Pre-populate 'Date acquired' field when adding/editing items -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|20.05 |master -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hm, as Koha always forced dateaccessioned itself, I wonder if this is not actually a data problem :( The field cannot be null, unless you explicitly forced it to be. When migrating data using the import tools, the date is also set. The only way to end up with empty is by migrating with SQL, I think. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- If we would remove the second $self->dateaccessioned($today) that is after the modify branch in store, we still have the effect that opening an item that has a NULL date in dateaccessioned will be populated with today due to 29815 (the value builder will put today in that field now). Does it make more sense to choose some arbitrary date for all unknown acquired dates and run a SQL update to replace the NULLs? And even the 0000-00-00 values that I still discovered in my table too? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 --- Comment #5 from Andreas Jonsson <andreas.jonsson@kreablo.se> --- Indeed, missing dateaccessioned fields stems from data migration. And sometimes there is not meaningful date in the source data, so it makes sense to allow it to be empty to indicate that the date is unknown. As it stands we have to use a garbage date such as 1901-01-01 to indicate that the date is unknown. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Adding see also to bug 27768. Strange values like 0000-00-00, 0001-01-01 etc. Date picker does not like them either. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=27768 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alexbuckley@catalyst.net.nz | |, | |jonathan.druart+koha@gmail. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29815 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #7 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #4)
Does it make more sense to choose some arbitrary date for all unknown acquired dates and run a SQL update to replace the NULLs? And even the 0000-00-00 values that I still discovered in my table too?
+1 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #8 from Fridolin Somers <fridolin.somers@biblibre.com> --- In any case, having $self->dateaccessioned($today) twice in store() is a bug. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29963 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Updating severity... maybe it will draw a patch? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |30060 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 [Bug 30060] Missing primary key on user_permissions -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|30060 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 [Bug 30060] Missing primary key on user_permissions -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 136504 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136504&action=edit Bug 29958: Do not set dateaccessioned on updates This patch reomves the second occurence of setting daeaccessioned today, outside of the 'add/update' handling in Koha::Item->store. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- There wasn't actually a unit test for this.. either way. I'm not sure what the repercussions are of having a null deaccessioned in the database? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 David Nind <david@davidnind.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=29958 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136504|0 |1 is obsolete| | --- Comment #12 from David Nind <david@davidnind.com> --- Created attachment 136555 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136555&action=edit Bug 29958: Do not set dateaccessioned on updates This patch reomves the second occurence of setting daeaccessioned today, outside of the 'add/update' handling in Koha::Item->store. Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes editing items release notes| |without an accession date - | |the accessioned date will | |remain empty, instead of | |being updated to today's | |date. CC| |david@davidnind.com --- Comment #13 from David Nind <david@davidnind.com> --- Testing notes: - Before patch applied: edit an item with an accessioned date, remove the accessioned date, update another field (for example: copy number), save ==> accessioned date changed to today (couldn't find a record/item without a date) - After patch applied: . edit an item with an accessioned date, remove the accessioned date, update another field (for example: copy number), save ==> accessioned date is empty . edit the same item, leaved accessioned date blank, edit another field (such as copy number), save ==> accessioned date remains empty -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=29958 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136555|0 |1 is obsolete| | --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 137052 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137052&action=edit Bug 29958: Do not set dateaccessioned on updates This patch reomves the second occurence of setting daeaccessioned today, outside of the 'add/update' handling in Koha::Item->store. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Martin: Any chance of adding a dbrev that is able to clear the date for these records too? For instance, we use the date to do acquisition reporting on year/month; and these data are useless now since we have a lot of old records without the date and checkins/checkouts now have added the date. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I don't think we can separate the accidental updates from the intended ones - so not sure how a database update could be written? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 --- Comment #17 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Katrin Fischer from comment #16)
I don't think we can separate the accidental updates from the intended ones - so not sure how a database update could be written?
I was thinking that we had a trace of eg a checkin/checkout and an item store but unfortunately the latter is missing: $issue->item->onloan(undef)->store({ log_action => 0, skip_record_index => $params->{skip_record_index} }); (from MarkIssueReturned) If we would have had both, we could make an educated guess. But if we only have an checkin or checkout without an item modification trace, I am afraid that it is not possible. Any more thoughts? Heading to the old database dumps ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137052|0 |1 is obsolete| | --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 137144 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137144&action=edit Bug 29958: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 --- Comment #19 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 137145 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137145&action=edit Bug 29958: Do not set dateaccessioned on updates This patch reomves the second occurence of setting daeaccessioned today, outside of the 'add/update' handling in Koha::Item->store. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 --- Comment #20 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00 |22.11.00, 22.05.04 released in| | Status|Pushed to master |Pushed to stable CC| |lucas@bywatersolutions.com --- Comment #21 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for 22.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arthur.suzuki@biblibre.com Status|Pushed to stable |Pushed to oldstable Version(s)|22.11.00, 22.05.04 |22.11.00, 22.05.04, released in| |21.11.11 --- Comment #22 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- pushed to 21.11.x for 21.11.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00, 22.05.04, |22.11.00, 22.05.04, released in|21.11.11 |21.11.11, 21.05.18 Resolution|--- |FIXED CC| |victor@tuxayo.net Status|Pushed to oldstable |RESOLVED --- Comment #23 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Backported: Pushed to 21.05.x branch for 21.05.18 Nothing to document, marking resolved. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Laura <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=32451 CC| |Laura.escamilla@bywatersolu | |tions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |32456 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32456 [Bug 32456] Date accessioned is now cleared when items are replaced -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org