[Koha-patches] [PATCH] Bug 5372 Existing value can be replace by default value

Frédéric Demians f.demians at tamil.fr
Sun Nov 7 13:26:14 CET 2010


The way an existing value was tested was wrong. 0 is a valid value but a
false value for Perl.

[3.2] Should also apply.
---
 cataloguing/addbiblio.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl
index 2cd6e73..de30aaa 100755
--- a/cataloguing/addbiblio.pl
+++ b/cataloguing/addbiblio.pl
@@ -299,7 +299,7 @@ sub create_input {
     }
 
     # if there is no value provided but a default value in parameters, get it
-    unless ($value) {
+    unless (defined $value) {
         $value = $tagslib->{$tag}->{$subfield}->{defaultvalue};
 
         # get today date & replace YYYY, MM, DD if provided in the default value
-- 
1.5.6.5



More information about the Koha-patches mailing list