[Bug 29719] New: onloan dates are cleared from items when importing and overlaying
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29719 Bug ID: 29719 Summary: onloan dates are cleared from items when importing and overlaying Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org To recreate: 1 - Check an item out to a paron 2 - Export the item using Tools->Export data 3 - Stage the record for import 4 - Match on 999c and replace items 5 - Import the batch 6 - View the record and note item is checked out and Available 7 - In the DB note the onloan value is now null -- 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=29719 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=29719 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 128635 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128635&action=edit Bug 29719: Unit tests -- 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=29719 --- Comment #2 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 128636 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128636&action=edit Bug 29719: Do not clear onloan value when not passed in MARC To test: 1 - Check an item out to a paron 2 - Export the item using Tools->Export data 3 - Stage the record for import 4 - Match on 999c and replace items 5 - Import the batch 6 - View the record and note item is checked out and Available 7 - In the DB note the onloan value is now null 8 - Check in the item 9 - Apply patch 10 - Repeat 1-5 11 - View the record and note item is checked out 12 - In the DB note the onloan value matches the due date -- 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=29719 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- 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=29719 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- It might get too late and I might be misunderstanding it all, but I am not sure if this fix is in the right spot. Instead of introducing the onloan special case to the general method in Object.pm, would the solution not be to add it to the $properties_hashref? 321 $item->{cn_source} = delete $item->{'items.cn_source'}; # Because of C4::Biblio::_disambiguate 322 delete $item->{'items.cn_sort'}; # Because of C4::Biblio::_disambiguate 323 $item->{itemnumber} = $itemnumber; 324 $item->{biblionumber} = $biblionumber; 325 326 my $existing_cn_sort = $item_object->cn_sort; # set_or_blank will reset cn_sort to undef as we are not passing it 327 # We rely on Koha::Item->store to modify it if itemcallnumber or cn_source is modified 328 $item_object = $item_object->set_or_blank($item); 279 =head3 $object->set_or_blank( $properties_hashref ) 280 281 $object->set_or_blank( 282 { 283 property1 => $property1, 284 property2 => $property2, 285 property3 => $propery3, 286 } 287 ); 288 289 If not listed in $properties_hashref, the property will be set to the default 290 value defined at DB level, or nulled. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29719 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29719 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128635|0 |1 is obsolete| | Attachment #128636|0 |1 is obsolete| | --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 129515 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129515&action=edit Bug 29719: Unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29719 --- Comment #5 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 129516 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129516&action=edit Bug 29719: Do not clear onloan value when not passed in MARC We blank the field to prevent users from setting it during import, but this has the affect of blanking it in the DB. This patch replaces the onloan field when not passed in to 'ModItemFromMARC' to preserve the value To test: 1 - Check an item out to a paron 2 - Export the item using Tools->Export data 3 - Stage the record for import 4 - Match on 999c and replace items 5 - Import the batch 6 - View the record and note item is checked out and Available 7 - In the DB note the onloan value is now null 8 - Check in the item 9 - Apply patch 10 - Repeat 1-5 11 - View the record and note item is checked out 12 - In the DB note the onloan value matches the due date -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29719 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |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=29719 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=29719 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #129515|0 |1 is obsolete| | --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 134662 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134662&action=edit Bug 29719: Unit tests 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=29719 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #129516|0 |1 is obsolete| | --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 134663 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134663&action=edit Bug 29719: Do not clear onloan value when not passed in MARC We blank the field to prevent users from setting it during import, but this has the affect of blanking it in the DB. This patch replaces the onloan field when not passed in to 'ModItemFromMARC' to preserve the value To test: 1 - Check an item out to a paron 2 - Export the item using Tools->Export data 3 - Stage the record for import 4 - Match on 999c and replace items 5 - Import the batch 6 - View the record and note item is checked out and Available 7 - In the DB note the onloan value is now null 8 - Check in the item 9 - Apply patch 10 - Repeat 1-5 11 - View the record and note item is checked out 12 - In the DB note the onloan value matches the due date 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=29719 --- Comment #8 from David Nind <david@davidnind.com> --- Testing notes (koha-testing-docker): - Note for me: remember to choose framework when importing staged records, otherwise it will fail - Query for step 7 where XX is the item you checked out: select * from items where itemnumber = XX; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29719 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=29719 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #134662|0 |1 is obsolete| | --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 134996 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134996&action=edit Bug 29719: Unit tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29719 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #134663|0 |1 is obsolete| | --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 134997 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134997&action=edit Bug 29719: Do not clear onloan value when not passed in MARC We blank the field to prevent users from setting it during import, but this has the affect of blanking it in the DB. This patch replaces the onloan field when not passed in to 'ModItemFromMARC' to preserve the value To test: 1 - Check an item out to a paron 2 - Export the item using Tools->Export data 3 - Stage the record for import 4 - Match on 999c and replace items 5 - Import the batch 6 - View the record and note item is checked out and Available 7 - In the DB note the onloan value is now null 8 - Check in the item 9 - Apply patch 10 - Repeat 1-5 11 - View the record and note item is checked out 12 - In the DB note the onloan value matches the due date Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29719 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Signed Off |Passed QA --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Good call on moving the fix Katrin :) All works as expected and Unit tests included. QA Script happy. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29719 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Good catch. Are there other columns to protect by default ? Like : issues, renewals, reserves ? booksellerid ? datelastseen ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29719 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.05.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=29719 --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to master for 22.05, thanks to everybody involved 🦄 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29719 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #14 from Lucas Gass <lucas@bywatersolutions.com> --- Can this be backported to 21.11? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org