From 757c9b4231399ca6082a00b66beca8e59c0b462b Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 7 Feb 2018 09:45:20 +0200 Subject: [PATCH] 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 Signed-off-by: Roch D'Amour Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Conflicts: koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt Signed-off-by: Nick Clemens --- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt index 44824f5c30..db53013338 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -164,7 +164,7 @@ } else { ids = new Array; } - if (ids.indexOf(borrowernumber) < 0) { + if (ids.indexOf(borrowernumber.toString()) < 0) { ids.push(borrowernumber); $("#users_ids").val(ids.join(':')); var li = '
  • '+borrowername -- 2.39.5