From fda72bf787a3d794899e4a2c1f4e86a9cabe021c Mon Sep 17 00:00:00 2001 From: Mason James Date: Mon, 29 Oct 2007 01:22:03 -0500 Subject: [PATCH] if() incorrectly eval-ing syspref value 'FALSE' as true, wrapping in boolean. if (C4::Boolean::true_p(C4::Context->preference("autoBarcode")) != 0 ) Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- serials/serials-edit.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index e59ea7aa9e..016b6a72df 100755 --- a/serials/serials-edit.pl +++ b/serials/serials-edit.pl @@ -72,6 +72,8 @@ use C4::Output; use C4::Context; use C4::Serials; +#use Smart::Comments; + my $query = new CGI; my $dbh = C4::Context->dbh; my @serialids = $query->param('serialid'); @@ -221,7 +223,8 @@ if ($op eq 'serialchangestatus') { #New Item # if autoBarcode is ON, calculate barcode... my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode"); - if (C4::Context->preference('autoBarcode')) { + if (C4::Boolean::true_p(C4::Context->preference("autoBarcode")) != 0 ) { + unless ($record->field($tagfield)->subfield($tagsubfield)) { my $sth_barcode = $dbh->prepare("select max(abs(barcode)) from items"); $sth_barcode->execute; -- 2.39.5