synch'ing 2.2 and head
[koha.git] / value_builder / unimarc_field_700_701_702.pl
index 685d038..dd899d0 100644 (file)
@@ -121,8 +121,8 @@ sub plugin {
        }
        if ($search_string) {
        #       my $sti=$dbh->prepare("select id,freelib from bibliothesaurus where freelib like '".$search_string."%' and category ='$category'");
-               my $sti=$dbh->prepare("select id,freelib from bibliothesaurus where match (category,freelib) AGAINST ('$search_string') and category ='NP'");
-               $sti->execute;
+               my $sti=$dbh->prepare("select id,freelib from bibliothesaurus where match (category,freelib) AGAINST (?) and category ='NP'");
+               $sti->execute($search_string);
                while (my $line=$sti->fetchrow_hashref) {
                        $stdlib{$line->{'id'}} = "$line->{'freelib'}";
                        push(@freelib,$line->{'id'});
@@ -147,7 +147,7 @@ sub plugin {
        $template->param(index => $index,
                                                        result =>$result,
                                                        select_list => $select_list,
-                                                       search_string => $search_string,
+                                                       search_string => $search_string?$search_string:$result,
                                                        a => $a,
                                                        b => $b,
                                                        c => $c,