From e8f0967c88d8bcbcda56530e5bf12d1736d29a98 Mon Sep 17 00:00:00 2001
From: Lucas Gass <lucas@bywatersolutions.com>
Date: Wed, 16 Feb 2022 19:46:08 +0000
Subject: [PATCH] Bug 30107: When editing desks default to the branch the desk
 belongs to

TO test:
1. Turn on UseCirculationDesks
2. Add some desks via Administration > Circulation desks, make several and have them belong to different libraries.
3. Go edit some of those desks and notice the Library: dropdown always defaults to the users logged in branch
4. Apply patch
5. Try editing desk again, now the dropdown should default the library that the desk belongs to.
---
 koha-tmpl/intranet-tmpl/prog/en/modules/admin/desks.tt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/desks.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/desks.tt
index 2043f68603..d545a07b39 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/desks.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/desks.tt
@@ -118,7 +118,7 @@
                     <select id="branchcode" name="branchcode" required="required">
                       <option value=""></option>
                       [% FOREACH branch IN branches %]
-                        [% IF (Branches.GetLoggedInBranchcode == branch.branchcode) %]
+                        [% IF desk.branchcode == branch.branchcode %]
                         <option value="[% branch.branchcode|html %]" selected="selected">[% branch.branchname|html %]</option>
                         [% ELSE %]
                         <option value="[% branch.branchcode|html %]">[% branch.branchname|html %]</option>
-- 
2.20.1