From 2cfb140d59b244729dd408a94d458d34ba7a18f7 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Mon, 9 May 2022 09:28:04 +0200
Subject: [PATCH] Bug 30603: Display Sort1 and Sort2 as free text if no AV
 exists

Test plan:
Don't define AV for Sort1 and Sort2, edit a patron
=> Should be editable via an input box

Define AVs for Sort1 and Sort2, edit a patron
=> Should see the dropdown
---
 koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc
index f3b57374fe4..263a190a150 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc
@@ -11,7 +11,7 @@
 [% SET avs = AuthorisedValues.GetAuthValueDropbox( category ) %]
 [% DEFAULT class = '' size = 20 %]
 
-[% IF avs %]
+[% IF avs.count %]
   <select id="[% name | html %]" name="[% name | html %]" class="[% class | html %]" >
   [% IF all %]<option value="">All</option>[% END %]
   [% IF empty %]<option value=""></option>[% END %]
-- 
2.25.1