Bug 20148

Summary: Don't allow adding same user multiple times to a basket or an order
Product: Koha Reporter: paxed <pasi.kallinen>
Component: AcquisitionsAssignee: paxed <pasi.kallinen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, katrin.fischer, nick, roch.damour
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20237
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 20148: Adding same user multiple times to acq basket
Bug 20148: Adding same user multiple times to acq basket
Bug 20148: Adding same user multiple times to acq basket
Bug 20148: Adding same user multiple times to acq basket
Bug 20148: Prevent adding same user multiple times to acq basket
Bug 20148: Prevent adding same user multiple times to an order

Description paxed 2018-02-07 07:54:22 UTC
When adding a user to manage acquisitions basket, it is possible to add the same user multiple times.
Comment 1 paxed 2018-02-07 07:55:40 UTC
Created attachment 71273 [details] [review]
Bug 20148: Adding same user multiple times to acq basket

When adding a user to manage acquisitions basket, it is possible
to add the same user multiple times. Prevent that.

Test plan:

1) Go to Home -> Acquisitions -> [bookseller] -> [basket]
2) On the "Add user" in the Managed by-part, and try adding
   the same user multiple times.
3) Apply patch
4) Repeat 1 and 2. You should now get an error message saying
   the user is already in the list.
Comment 2 Roch D'Amour 2018-02-16 21:23:45 UTC
Created attachment 71862 [details] [review]
Bug 20148: Adding same user multiple times to acq basket

When adding a user to manage acquisitions basket, it is possible
to add the same user multiple times. Prevent that.

Test plan:

1) Go to Home -> Acquisitions -> [bookseller] -> [basket]
2) On the "Add user" in the Managed by-part, and try adding
   the same user multiple times.
3) Apply patch
4) Repeat 1 and 2. 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: Roch D'Amour <roch.damour@inlibro.com>
Comment 3 Roch D'Amour 2018-02-16 21:24:28 UTC
Created attachment 71863 [details] [review]
Bug 20148: Adding same user multiple times to acq basket

When adding a user to manage acquisitions basket, it is possible
to add the same user multiple times. Prevent that.

Test plan:

1) Go to Home -> Acquisitions -> [bookseller] -> [basket]
2) On the "Add user" in the Managed by-part, and try adding
   the same user multiple times.
3) Apply patch
4) Repeat 1 and 2. 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: Roch D'Amour <roch.damour@inlibro.com>
Comment 4 Katrin Fischer 2018-02-18 10:34:56 UTC
Created attachment 71898 [details] [review]
Bug 20148: Adding same user multiple times to acq basket

When adding a user to manage acquisitions basket, it is possible
to add the same user multiple times. Prevent that.

Test plan:

1) Go to Home -> Acquisitions -> [bookseller] -> [basket]
2) On the "Add user" in the Managed by-part, and try adding
   the same user multiple times.
3) Apply patch
4) Repeat 1 and 2. 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: Roch D'Amour <roch.damour@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Katrin Fischer 2018-02-18 10:36:50 UTC
Created attachment 71899 [details] [review]
Bug 20148: Prevent adding same user multiple times to acq basket

When adding a user to manage acquisitions basket, it is possible
to add the same user multiple times. Prevent that.

Test plan:

1) Go to Home -> Acquisitions -> [bookseller] -> [basket]
2) On the "Add user" in the Managed by-part, and try adding
   the same user multiple times.
3) Apply patch
4) Repeat 1 and 2. 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: Roch D'Amour <roch.damour@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2018-02-18 10:38:39 UTC
Hi paxed, thx for the bug fix! Please make sure your patch subject describes the change (see https://wiki.koha-community.org/wiki/Commit_messages). 
I've amended it a little to do that.
I am going to file another bug for adding users to get notified on receive - same problem there.
Comment 7 Jonathan Druart 2018-02-18 18:11:15 UTC
Created attachment 71915 [details] [review]
Bug 20148: Prevent adding same user multiple times to an order

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2018-02-18 18:11:20 UTC
*** Bug 20237 has been marked as a duplicate of this bug. ***
Comment 9 Jonathan Druart 2018-02-18 19:50:43 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 10 Nick Clemens 2018-03-23 12:48:53 UTC
Awesome work all! Pushed to stable for 17.11.04
Comment 11 Fridolin Somers 2018-03-27 09:43:49 UTC
Pushed to 17.05.x for v17.05.10