From d002eadf785accfc73bfa7c8d8d28f32fa501822 Mon Sep 17 00:00:00 2001
From: Julian Maurice <julian.maurice@biblibre.com>
Date: Tue, 14 May 2019 14:53:54 +0200
Subject: [PATCH] Bug 22630: Fix homebranch select's value in course item edit
 page
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Sponsored-by: Université de Lyon 3
Signed-off-by: SONIA BOUIS <sonia.bouis@univ-lyon3.fr>
---
 .../prog/en/modules/course_reserves/add_items-step2.tt          | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt
index b59af815dd..0aa56a0166 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/course_reserves/add_items-step2.tt
@@ -88,7 +88,7 @@
                         <select id="homebranch" name="homebranch">
                             <option value="">LEAVE UNCHANGED</option>
                             [% FOREACH b IN Branches.all() %]
-                                [% IF course_item.homebranch.defined && ( ( course.enabled == 'yes' && b.value == item.homebranch ) || ( course.enabled == 'no' && b.value == course_item.homebranch ) ) %]
+                                [% IF course_item.homebranch.defined && ( ( course.enabled == 'yes' && b.branchcode == item.homebranch ) || ( course.enabled == 'no' && b.branchcode == course_item.homebranch ) ) %]
                                     <option value="[% b.branchcode | html %]" selected="selected">[% b.branchname | html %]</option>
                                 [% ELSE %]
                                     <option value="[% b.branchcode | html %]">[% b.branchname | html %]</option>
-- 
2.20.1