@@ -, +, @@ --- C4/Tags.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/C4/Tags.pm +++ a/C4/Tags.pm @@ -30,7 +30,6 @@ use constant TAG_FIELDS => qw(tag_id borrowernumber biblionumber term language d use constant TAG_SELECT => "SELECT " . join(',', TAG_FIELDS) . "\n FROM tags_all\n"; use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); -our $ext_dict; BEGIN { @ISA = qw(Exporter); @@ -50,7 +49,7 @@ BEGIN { stratify_tags ); # %EXPORT_TAGS = (); - $ext_dict = C4::Context->preference('TagsExternalDictionary'); + my $ext_dict = C4::Context->preference('TagsExternalDictionary'); if ($debug) { require Data::Dumper; import Data::Dumper qw(:DEFAULT); @@ -69,6 +68,7 @@ More verose debugging messages are sent in the presence of non-zero $ENV{"DEBUG" =cut INIT { + my $ext_dict = C4::Context->preference('TagsExternalDictionary'); $ext_dict and $Lingua::Ispell::path = $ext_dict; $debug and print STDERR "\$Lingua::Ispell::path = $Lingua::Ispell::path\n"; } @@ -367,6 +367,7 @@ sub is_approved { my $term = shift or return; my $sth = C4::Context->dbh->prepare("SELECT approved FROM tags_approval WHERE term = ?"); $sth->execute($term); + my $ext_dict = C4::Context->preference('TagsExternalDictionary'); unless ($sth->rows) { $ext_dict and return (spellcheck($term) ? 0 : 1); # spellcheck returns empty on OK word return 0; @@ -390,6 +391,7 @@ sub get_tag_index { sub whitelist { my $operator = shift; defined $operator or return; # have to test defined to allow =0 (kohaadmin) + my $ext_dict = C4::Context->preference('TagsExternalDictionary'); if ($ext_dict) { foreach (@_) { spellcheck($_) or next; --