Bug 32398 - Patron import may partially delete restrictions
Summary: Patron import may partially delete restrictions
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-02 19:22 UTC by Andrew Fuerste-Henry
Modified: 2022-12-04 13:00 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2022-12-02 19:22:59 UTC
To recreate:
1 - have a patron, put a manual restriction on their account
2 - create a CSV for patron import that matches your patron
3 - add the debarred and debarredcomment columns to your CSV, but don't put any values into them for your test patron
4 - import your file, matching your patron, and overwriting the existing patron with the new data
5 - reload your patron's record
6 - confirm your patron is allowed to check out but that the Restrictions tab still lists the restriction created in step 1

The patron import nulls out borrowers.debarred and borrowers.debarredcomment but does not update the borrower_debarments table. This leaves the patron with a zombie debarment that doesn't get enforced.

I'm not entirely sure what the right answer here is. Either we should not allow patron imports to delete debarments at all or we should make sure it does the deletion properly and completely.

For comparison, if one uses batch patron modification to clear the debarred and debarredcomment fields, Koha deletes ALL debarments on that account.
Comment 1 Katrin Fischer 2022-12-04 13:00:26 UTC
I think we should not allow to undebar with the patron import or have a more solid way to indicate it than leaving columns empty. Like indicating the restriction codes that you want to lift.

There can be multiple restrictions added for very different reasons, not only one, I think that's the main issue.

So I think empty columns should just be ignored on import.