use Carp;
use base qw(Koha::SuggestionEngine::Base);
-our $NAME = 'AuthorityFile';
-our $VERSION = '1.0';
+
+=head2 NAME
+ my $name = $plugin->NAME;
+
+=cut
+
+sub NAME {
+ return 'AuthorityFile';
+}
+
+=head2 VERSION
+ my $version = $plugin->VERSION;
+
+=cut
+
+sub VERSION {
+ return '1.1';
+}
=head2 get_suggestions
{
'search' => "an=$auth->{'authid'}",
relevance => $count--,
- label => $auth->{summary}->{authorized}->[0]
+ label => $auth->{summary}->{authorized}->[0]->{heading}
};
}
return \@results;
}
+
+1;
'reported_tag' => undef,
'even' => 0,
'summary' => {
- 'authorized' => [ 'Cooking' ],
+ 'authorized' => [ { 'heading' => 'Cooking' } ],
'otherscript' => [],
'seefrom' => [ 'Cookery' ],
'notes' => [ 'Your quintessential poor heading selection' ],
} ], 1
});
-my $suggestor = Koha::SuggestionEngine->new( { plugins => ( 'AuthorityFile' ) } );
+my $suggestor = Koha::SuggestionEngine->new( { plugins => [ 'AuthorityFile' ] } );
is(ref($suggestor), 'Koha::SuggestionEngine', 'Created suggestion engine');
my $result = $suggestor->get_suggestions({search => 'Cookery'});