Coming from: Bug 23463: Use new method Koha::Object->set_or_blank We have DB fields that are not mapped with MARC fields, for instance paidfor. They are not handled correctly. In ModItemFromMarc, we get a MARC record in parameter and update the item in DB. But we are loosing the fields that are not in the MARC record.
Created attachment 106695 [details] [review] Bug 25964: Prevent data loss when editing items from a MARC record Coming from: Bug 23463: Use new method Koha::Object->set_or_blank We have DB fields that are not mapped with MARC fields, for instance paidfor. They are not handled correctly. In ModItemFromMarc, we get a MARC record in parameter and update the item in DB. But we are loosing the fields that are not in the MARC record
I don't have much time to investigate the consequence of this bug but it sounds quite bad. Could you have a look?
Sounds bad. I haven't looked either. Trying to remember where ModItemFromMarc gets called...
Created attachment 106752 [details] [review] Bug 25964: Prevent data loss when editing items from a MARC record Coming from: Bug 23463: Use new method Koha::Object->set_or_blank We have DB fields that are not mapped with MARC fields, for instance paidfor. They are not handled correctly. In ModItemFromMarc, we get a MARC record in parameter and update the item in DB. But we are loosing the fields that are not in the MARC record Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
My test plan was to apply this patch on top of bug 20271 and run: prove t/db_dependent/Items.t to confirm that it's fixed. See bug 20271 comment 243. And then apply it to master, run the same test to confirm that it still passes. And attach the signed off patch here (the on-top-of-master one) Is that a good test? If so we can mark this ticket as signed off
Created attachment 106765 [details] [review] Bug 25964: Prevent data loss when editing items from a MARC record Coming from: Bug 23463: Use new method Koha::Object->set_or_blank We have DB fields that are not mapped with MARC fields, for instance paidfor. They are not handled correctly. In ModItemFromMarc, we get a MARC record in parameter and update the item in DB. But we are loosing the fields that are not in the MARC record Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
I'm comfortable that this patch fixes the issue and I'm not seeing any obvious regressions... Passing QA
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.03
missing dependencies, not backported to 19.11.x