Summary: | Don't allow adding same user multiple times to same budget fund | ||
---|---|---|---|
Product: | Koha | Reporter: | paxed <pasi.kallinen> |
Component: | Acquisitions | Assignee: | paxed <pasi.kallinen> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | nick |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Fix adding same user to the same budget fund multiple times
Bug 20110: Adding same user multiple times to same budget Bug 20110: Adding same user multiple times to same budget |
Description
paxed
2018-01-31 09:37:04 UTC
Created attachment 71082 [details] [review] Fix adding same user to the same budget fund multiple times In javascript, using indexOf to test if a number exists in an array of strings doesn't work, and makes it possible to add the same user multiple times into the same budget fund. Make borrowernumber into string and compare that instead. Test plan: 1) Go to Home -> Administration -> Budgets -> Funds -> Add Fund 2) Add a user to the fund 3) Try to add the same user again to the same fund. No error. 4) Apply patch 5) Do 1, 2, and 3 again. You should now get an error message saying the user is already in the list. Created attachment 71099 [details] [review] Bug 20110: Adding same user multiple times to same budget In javascript, using indexOf to test if a number exists in an array of strings doesn't work, and makes it possible to add the same user multiple times into the same budget fund. Make borrowernumber into string and compare that instead. Test plan: 1) Go to Home -> Administration -> Budgets -> Funds -> Add Fund 2) Add a user to the fund 3) Try to add the same user again to the same fund. No error. 4) Apply patch 5) Do 1, 2, and 3 again. You should now get an error message saying the user is already in the list. Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Created attachment 71174 [details] [review] Bug 20110: Adding same user multiple times to same budget In javascript, using indexOf to test if a number exists in an array of strings doesn't work, and makes it possible to add the same user multiple times into the same budget fund. Make borrowernumber into string and compare that instead. Test plan: 1) Go to Home -> Administration -> Budgets -> Funds -> Add Fund 2) Add a user to the fund 3) Try to add the same user again to the same fund. No error. 4) Apply patch 5) Do 1, 2, and 3 again. You should now get an error message saying the user is already in the list. Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi> Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Pushed to master for 18.05, thanks to everybody involved! Awesome work all, pushed to stable for 17.11.03 |