[Koha-patches] [PATCH] Prevent js failure if syspref "gist" is undefined.

Joe Atzberger joe.atzberger at liblime.com
Wed Jan 21 02:18:22 CET 2009


The javascript is malformed and therefore fails the onsubmit check if
gist does not receive a value.  This patch allows failover to default 0.
Also removed an unused dbh.
---
 acqui/neworderempty.pl |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl
index 8baa60b..df23586 100755
--- a/acqui/neworderempty.pl
+++ b/acqui/neworderempty.pl
@@ -94,7 +94,6 @@ my $suggestionid = $input->param('suggestionid');
 my $close        = $input->param('close');
 my $data;
 my $new;
-my $dbh = C4::Context->dbh;
 
 if ( $ordnum eq '' ) {    # create order
     $new = 'yes';
@@ -262,7 +261,7 @@ $template->param(
     nocalc           => $bookseller->{'nocalc'},
     name             => $bookseller->{'name'},
     currency         => $bookseller->{'listprice'},
-    gstrate          => C4::Context->preference("gist"),
+    gstrate          => C4::Context->preference("gist") || 0,
     loop_currencies  => \@loop_currency,
     orderexists      => ( $new eq 'yes' ) ? 0 : 1,
     title            => $data->{'title'},
-- 
1.5.5.GIT




More information about the Koha-patches mailing list