#1447 : avoid a SQL message when filling the table
authorPaul POULAIN <paul@koha-fr.org>
Fri, 5 Oct 2007 09:39:37 +0000 (04:39 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Sat, 6 Oct 2007 00:40:05 +0000 (19:40 -0500)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
misc/cronjobs/build_browser_and_cloud.pl

index ecce40e..02ddcb0 100755 (executable)
@@ -37,7 +37,7 @@ if ($version || (!$confirm)) {
      export PERL5LIB=/path/to/koha;export KOHA_CONF=/etc/koha.xml;./build_browser_and_cloud.pl -b -f 676a -t 606 -c
 EOF
 ;
-die;
+exit;
 }
 
 ##################################
@@ -121,6 +121,7 @@ if ($browser_tag) {
     if (C4::Context->preference('opaclanguages') eq 'fr' && $browser_tag eq '676' & $browser_subfield eq 'a') {
         $classification = dewey_french();
     }
+
     foreach (keys %browser_result) {
         my $father = substr($_,0,-1);
         $browser_result{$father}->{notendnode}=1;
@@ -128,7 +129,7 @@ if ($browser_tag) {
     $dbh->do("truncate browser");
     my $sth = $dbh->prepare("insert into browser (level,classification,description,number,endnode) values (?,?,?,?,?)");
     foreach (keys %browser_result) {
-        $sth->execute(length($_),$_,$classification->{$_}?$classification->{$_}:"classification $_",$browser_result{$_}->{value},$browser_result{$_}->{notendnode}?0:1);
+        $sth->execute(length($_),$_,$classification->{$_}?$classification->{$_}:"classification $_",$browser_result{$_}->{value},$browser_result{$_}->{notendnode}?0:1) if $browser_result{$_}->{value};
     }
 }