[Koha] Linking biblios to authorities
Colin Campbell
colin.campbell at ptfs-europe.com
Tue Apr 14 22:50:21 NZST 2009
Bernardo Gonzalez Kriegel wrote:
>
> What wonders me is why is not working the script
> "/usr/share/koha/bin/link_bibs_to_authorities.pl"?
> When we run it, all we obtained is the removal of the links to
> authorities that we have!
>
> An inspection of the file shows that it use the
> procedure LinkBibHeadingsToAuthorities() from C4/Biblio.pm.
> In that file the following line
>
> my $authorities = $heading->authorities();
>
> gives a null result and that explains the removal of my links (following
> the algorithm).
> Inspecting C4/Heading.pm we found that the line to find matching
> authorities is
>
> my ($error, $results, $total_hits) = SimpleSearch( $query, undef,
> undef, [ "authorityserver" ] );
>
> which in turn guides us to C4/Search.pm (implementation of
> SimpleSearch), in which there is this line
>
> $zoom_queries[$i] = new ZOOM::Query::CCL2RPN( $query,
> $zconns[$i]);
>
The problem is probably in the $query. The zebrasrv may be logging an
error that clarifies this. A problem I've found in running this job is
that the query is using an undefined attribute. Try this change in
AuthoritiesMarc.pm:
diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm
index f9bf733..32dec17 100644
--- a/C4/AuthoritiesMarc.pm
+++ b/C4/AuthoritiesMarc.pm
@@ -220,7 +220,7 @@ sub SearchAuthorities {
if (@$value[$i]){
##If mainentry search $a tag
if (@$tags[$i] eq "mainmainentry") {
- $attr =" \@attr 1=Heading-Main ";
+ $attr =" \@attr 1=Heading ";
}elsif (@$tags[$i] eq "mainentry") {
$attr =" \@attr 1=Heading ";
The change is present in HEAD but not in 3.0.x
Hope that helps
Colin
--
Colin Campbell
Software Engineer, PTFS Europe Limited
Content Management and Library Solutions
+44 (0) 208 366 1295 (phone)
+44 (0) 7759 633626 (mobile)
colin.campbell at ptfs-europe.com
skype: colin_campbell2
http://www.ptfs-europe.com
More information about the Koha
mailing list