Bug 29761 - Patron batch modification tool - duplicated information on the listing page
Summary: Patron batch modification tool - duplicated information on the listing page
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Alex Buckley
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-23 05:22 UTC by David Nind
Modified: 2022-06-06 20:31 UTC (History)
4 users (show)

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


Attachments
Screenshot - duplicate rows if same number entered more than once (64.43 KB, image/png)
2021-12-23 05:22 UTC, David Nind
Details
Bug 29761: Batch patron modification page should display patrons once if the same ID is inputted multiple times (2.59 KB, patch)
2022-01-06 00:47 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 29761: Batch patron modification page should display patrons once if the same ID is inputted multiple times (2.71 KB, patch)
2022-01-20 18:02 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 29761: Batch patron modification page should display patrons once if the same ID is inputted multiple times (2.64 KB, patch)
2022-01-20 18:02 UTC, David Nind
Details | Diff | Splinter Review
Bug 29761: Prevent batch patron modification to process several time the same patron (2.72 KB, patch)
2022-02-17 16:10 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Nind 2021-12-23 05:22:05 UTC
Created attachment 128878 [details]
Screenshot - duplicate rows if same number entered more than once

If a card number or borrower number is entered twice or more (either in the input file or the input form), then each patron with that number is shown twice on the patron batch modification page - see the screenshot.

This doesn't affect the end result - you can still successfully update the patron information.

It may also not happen very frequently, as you would normally only enter the patron card number or borrower number once. 

This was identified when testing bug 23291, which adds the SMS number as an option for performing patron batch modifications. Multiple patrons may have the same SMS number.
Comment 1 Alex Buckley 2021-12-24 00:02:27 UTC
Working on this. Will attach the finished patch when I'm back from leave on the 5th of January
Comment 2 David Nind 2021-12-24 01:33:02 UTC
+1
Comment 3 Alex Buckley 2022-01-05 20:01:31 UTC
Back from leave and working on this bug now
Comment 4 Alex Buckley 2022-01-06 00:47:01 UTC
Created attachment 129046 [details] [review]
Bug 29761: Batch patron modification page should display patrons once if the same ID is inputted multiple times

If a cardnumber, SMS number, or borrower number is inputted multiple times then the batch patron
modification page should not display that patron multiple times.

Test plan:
1. Create three text files that list card numbers, SMS numbers, and borrower numbers for three patrons. Example lists are below, notice in each there is one number duplicated:

Card numbers:
  23529000035676
  23529000651225
  23529000080862
  23529000035676

Borrower numbers:
  19
  49
  7
  49

SMS numbers:
  2125551212
  2125551212
  2125551213
  2125551214

2. Enable sending of SMS messages:
* Set SMSSendDriver system preference to Email

3. Make sure the cardnumbers, borrower numbers, and SMS numbers listed
above belong to patrons in your Koha

4. Go to Tools > Batch patron modification

5. Upload lists of cardnumbers, SMS numbers, and borrower numbers above, and confirm the following is happening in the batch patron modification page:
- Upload the text file of cardnumbers. Notice one patron is displayed twice
- Paste in the list of cardnumbers. Notice one patron is displayed twice
- Upload the text file of SMS numbers. Notice one patron is displayed twice
- Paste in the list of SMS numbers. Notice one patron is displayed twice
- Upload the text file of borrower numbers. Notice one patron is displayed twice
- Paste in the list of borrower numbers. Notice one patron is displayed twice

6. Apply patch and restart services

7. Repeat step 5 and this time observe that the patron record is not duplicated in the batch patron modification page

Sponsored-By: Catalyst IT
Comment 5 Alex Buckley 2022-01-06 00:49:00 UTC
Ready for testing!
Comment 6 Owen Leonard 2022-01-20 18:02:24 UTC
Created attachment 129671 [details] [review]
Bug 29761: Batch patron modification page should display patrons once if the same ID is inputted multiple times

If a cardnumber, SMS number, or borrower number is inputted multiple
times then the batch patron modification page should not display that
patron multiple times.

Test plan:
1. Create three text files that list card numbers, SMS numbers, and
   borrower numbers for three patrons. Example lists are below, notice
   in each there is one number duplicated:

Card numbers:
  23529000035676
  23529000651225
  23529000080862
  23529000035676

Borrower numbers:
  19
  49
  7
  49

SMS numbers:
  2125551212
  2125551212
  2125551213
  2125551214

2. Enable sending of SMS messages:
   * Set SMSSendDriver system preference to Email

3. Make sure the cardnumbers, borrower numbers, and SMS numbers listed
   above belong to patrons in your Koha

4. Go to Tools > Batch patron modification

5. Upload lists of cardnumbers, SMS numbers, and borrower numbers above,
   and confirm the following is happening in the batch patron
   modification page:
   - Upload the text file of cardnumbers. Notice one patron is displayed
     twice
   - Paste in the list of cardnumbers. Notice one patron is displayed
     twice
   - Upload the text file of SMS numbers. Notice one patron is displayed
     twice
   - Paste in the list of SMS numbers. Notice one patron is displayed
     twice
   - Upload the text file of borrower numbers. Notice one patron is
     displayed twice
   - Paste in the list of borrower numbers. Notice one patron is
     displayed twice

6. Apply patch and restart services

7. Repeat step 5 and this time observe that the patron record is not
   duplicated in the batch patron modification page

Sponsored-By: Catalyst IT

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 7 David Nind 2022-01-20 18:02:54 UTC
Created attachment 129672 [details] [review]
Bug 29761: Batch patron modification page should display patrons once if the same ID is inputted multiple times

If a cardnumber, SMS number, or borrower number is inputted multiple times then the batch patron
modification page should not display that patron multiple times.

Test plan:
1. Create three text files that list card numbers, SMS numbers, and borrower numbers for three patrons. Example lists are below, notice in each there is one number duplicated:

Card numbers:
  23529000035676
  23529000651225
  23529000080862
  23529000035676

Borrower numbers:
  19
  49
  7
  49

SMS numbers:
  2125551212
  2125551212
  2125551213
  2125551214

2. Enable sending of SMS messages:
* Set SMSSendDriver system preference to Email

3. Make sure the cardnumbers, borrower numbers, and SMS numbers listed
above belong to patrons in your Koha

4. Go to Tools > Batch patron modification

5. Upload lists of cardnumbers, SMS numbers, and borrower numbers above, and confirm the following is happening in the batch patron modification page:
- Upload the text file of cardnumbers. Notice one patron is displayed twice
- Paste in the list of cardnumbers. Notice one patron is displayed twice
- Upload the text file of SMS numbers. Notice one patron is displayed twice
- Paste in the list of SMS numbers. Notice one patron is displayed twice
- Upload the text file of borrower numbers. Notice one patron is displayed twice
- Paste in the list of borrower numbers. Notice one patron is displayed twice

6. Apply patch and restart services

7. Repeat step 5 and this time observe that the patron record is not duplicated in the batch patron modification page

Sponsored-By: Catalyst IT

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2022-01-20 18:11:37 UTC
Testing notes (koha-testing-docker):

1. For step 5, before the patch is applied, the tab for 'By SMS number' is not available (at the date of testing) unless you apply patch 23291 first. Otherwise, it will appear once the patch for this bug is applied.

2. To add the SMS numbers, you need to edit each patron and add the mobile number to the SMS number field that appears as part of Patron messaging preferences (once the SMSSendDriver system preference is changed to Email).
Comment 9 Jonathan Druart 2022-02-08 17:50:29 UTC
Blocked by bug 23291.
Comment 10 Jonathan Druart 2022-02-17 16:10:23 UTC
Created attachment 130763 [details] [review]
Bug 29761: Prevent batch patron modification to process several time the same patron

If a cardnumber, SMS number, or borrower number is inputted multiple times then the batch patron
modification page should not display that patron multiple times.

Test plan:
1. Create three text files that list card numbers, SMS numbers, and borrower numbers for three patrons. Example lists are below, notice in each there is one number duplicated:

Card numbers:
  23529000035676
  23529000651225
  23529000080862
  23529000035676

Borrower numbers:
  19
  49
  7
  49

SMS numbers:
  2125551212
  2125551212
  2125551213
  2125551214

2. Enable sending of SMS messages:
* Set SMSSendDriver system preference to Email

3. Make sure the cardnumbers, borrower numbers, and SMS numbers listed
above belong to patrons in your Koha

4. Go to Tools > Batch patron modification

5. Upload lists of cardnumbers, SMS numbers, and borrower numbers above, and confirm the following is happening in the batch patron modification page:
- Upload the text file of cardnumbers. Notice one patron is displayed twice
- Paste in the list of cardnumbers. Notice one patron is displayed twice
- Upload the text file of SMS numbers. Notice one patron is displayed twice
- Paste in the list of SMS numbers. Notice one patron is displayed twice
- Upload the text file of borrower numbers. Notice one patron is displayed twice
- Paste in the list of borrower numbers. Notice one patron is displayed twice

6. Apply patch and restart services

7. Repeat step 5 and this time observe that the patron record is not duplicated in the batch patron modification page

Sponsored-By: Catalyst IT

Signed-off-by: David Nind <david@davidnind.com>

JD Amended patch: adjust commit title
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Fridolin Somers 2022-02-22 01:14:13 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 12 Kyle M Hall 2022-02-25 13:19:07 UTC
Pushed to 21.11.x for 21.11.03
Comment 13 Andrew Fuerste-Henry 2022-03-07 20:23:21 UTC
Doesn't apply cleanly to 21.05, please rebase if needed.