From 8be601a74889efb2be25d7c90f8d34a3a610e589 Mon Sep 17 00:00:00 2001 From: Jeremy Breuillard Date: Wed, 24 Nov 2021 10:45:46 +0100 Subject: [PATCH] Bug 27550: "Duplicate budget" does not keep users associated with that budget When a budget is duplicated, Owner is copied but not Users Test plan : Home > Administration > Budgets 1)Create a budget to allow (active or inactive) 2)Give it some funds by filling up the form, especially Owner and User(s) 3)Submit then go back to the Budgets dashboard 4)Duplicate the Budget and click on its name 5)Edit it and notice that User(s) is empty 6)Apply the patch 7)Repeat from 1) to 5) Signed-off-by: Samu Heiskanen Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit ed97960cd7f8105eb5f913770089218cf7dd559d) Signed-off-by: Lucas Gass (cherry picked from commit 2d5529915b55acf0563e85e5ba68a6bbff79d5f7) Signed-off-by: Arthur Suzuki --- C4/Budgets.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/C4/Budgets.pm b/C4/Budgets.pm index 9624650be1..6b9e59a630 100644 --- a/C4/Budgets.pm +++ b/C4/Budgets.pm @@ -1285,6 +1285,8 @@ sub CloneBudgetHierarchy { budget_period_id => $new_budget_period_id } ); + my @borrowernumbers = GetBudgetUsers($budget->{budget_id}); + ModBudgetUsers($new_budget_id, @borrowernumbers); CloneBudgetHierarchy( { budgets => $budgets, -- 2.39.2