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.
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.)
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>