Bug 37863 - Patron card batches don't detect when the patron is already in the list
Summary: Patron card batches don't detect when the patron is already in the list
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Chris Nighswonger
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-09 07:13 UTC by Adolfo Rodríguez Taboada
Modified: 2024-09-09 20:41 UTC (History)
1 user (show)

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


Attachments
bug 37863 Fix checking if a patron is already in the list adding users to a patron card batch (1.75 KB, patch)
2024-09-09 07:21 UTC, Adolfo Rodríguez Taboada
Details | Diff | Splinter Review
bug 37863 Fix checking if a patron is already in the list adding users to a patron card batch (1.82 KB, patch)
2024-09-09 20:41 UTC, Sukhmandeep
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Adolfo Rodríguez Taboada 2024-09-09 07:13:33 UTC
When adding patrons to a batch from the modal the include file patron-search.inc is designed to show a success message (Patron '%s' added) or an error message (Patron '%s' is already in the list.) depending on the result of the function add_user. If add_user returned a negative number, it would show the error message. Otherwise it shows the success message. The problem is that the function add_user at the template edit_batch.tt doesn't return anything, so the system always adds the user, thus allowing to include several times the same user in the card batch.
Comment 1 Adolfo Rodríguez Taboada 2024-09-09 07:21:25 UTC
Created attachment 171170 [details] [review]
bug 37863 Fix checking if a patron is already in the list adding users to a patron card batch

If the patron is already in the card batch it won't add it and it will show an error message

Test plan:
1 Create or edit an patron card batch
2 Try adding twice or more the same patron. It will show a success message everytime and you will end up with the same patron several times in the card batch
3 Apply patch, restart services
4 Repeat step 2. The first time you click on add user, it will do it and show the success message (Patron 'Patron name' added.), but after that it won't add the user and it will display an error message (Patron 'Patron name' is already in the list.)
Comment 2 Sukhmandeep 2024-09-09 20:41:01 UTC
Created attachment 171233 [details] [review]
bug 37863 Fix checking if a patron is already in the list adding users to a patron card batch

If the patron is already in the card batch it won't add it and it will show an error message

Test plan:
1 Create or edit an patron card batch
2 Try adding twice or more the same patron. It will show a success message everytime and you will end up with the same patron several times in the card batch
3 Apply patch, restart services
4 Repeat step 2. The first time you click on add user, it will do it and show the success message (Patron 'Patron name' added.), but after that it won't add the user and it will display an error message (Patron 'Patron name' is already in the list.)

Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com>