[Koha-patches] [PATCH] [SIGNED-OFF] Bug 3727: Corrects the behaviour of the itemtype selectbox in addbiblio.pl

Julian Maurice julian.maurice at biblibre.com
Fri Apr 1 12:23:12 CEST 2011


From: Frédérick Capovilla <frederick.capovilla at sys-tech.net>

If the subfield is set as mandatory with an empty default value, an
empty value is added in the selectbox and this value is selected by
default. Before, the first element was automatically selected, so it was
easy to forget to set this mandatory value.

Signed-off-by: Julian Maurice <julian.maurice at biblibre.com>
---
 cataloguing/addbiblio.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl
index cd5691e..60f8e15 100755
--- a/cataloguing/addbiblio.pl
+++ b/cataloguing/addbiblio.pl
@@ -189,7 +189,7 @@ sub build_authorized_values_list ($$$$$$$) {
             "select itemtype,description from itemtypes order by description");
         $sth->execute;
         push @authorised_values, ""
-          unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
+          unless ( $tagslib->{$tag}->{$subfield}->{defaultvalue} and $tagslib->{$tag}->{$subfield}->{mandatory} );
           
         my $itemtype;
         
-- 
1.7.4.1



More information about the Koha-patches mailing list