added autocomplete="off"
[koha.git] / C4 / Heading.pm
index 0a23f94..ba9d23f 100644 (file)
@@ -18,11 +18,13 @@ package C4::Heading;
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
+#use warnings; FIXME - Bug 2505
 use MARC::Record;
 use MARC::Field;
 use C4::Context;
 use C4::Heading::MARC21;
 use C4::Search;
+use Carp;
 
 our $VERSION = 3.00;
 
@@ -32,12 +34,12 @@ C4::Heading
 
 =head1 SYNOPSIS
 
-use C4::Heading;
-my $heading = C4::Heading->new_from_bib_field($field);
-my $thesaurus = $heading->thesaurus();
-my $type = $heading->type();
-my $display_heading = $heading->display();
-my $search_string = $heading->search_string();
+ use C4::Heading;
+ my $heading = C4::Heading->new_from_bib_field($field);
+ my $thesaurus = $heading->thesaurus();
+ my $type = $heading->type();
+ my $display_heading = $heading->display();
+ my $search_string = $heading->search_string();
 
 =head1 DESCRIPTION
 
@@ -48,11 +50,7 @@ headings found in bibliographic and authority records.
 
 =head2 new_from_bib_field
 
-=over 4
-
-my $heading = C4::Heading->new_from_bib_field($field[, $marc_flavour]);
-
-=back
+  my $heading = C4::Heading->new_from_bib_field($field[, $marc_flavour]);
 
 Given a C<MARC::Field> object containing a heading from a 
 bib record, create a C<C4::Heading> object.
@@ -87,11 +85,7 @@ sub new_from_bib_field {
 
 =head2 display_form
 
-=over 4
-
-my $display = $heading->display_form();
-
-=back
+  my $display = $heading->display_form();
 
 Return the "canonical" display form of the heading.
 
@@ -104,11 +98,7 @@ sub display_form {
 
 =head2 authorities
 
-=over 4
-
-my $authorities = $heading->authorities;
-
-=back
+  my $authorities = $heading->authorities;
 
 Return a list of authority records for this 
 heading.
@@ -117,19 +107,18 @@ heading.
 
 sub authorities {
     my $self = shift;
-    my $query = qq(Match-heading,ext="$self->{'search_form'}");
+    my $query = qq(Match-heading,do-not-truncate,ext="$self->{'search_form'}");
     $query .= $self->_query_limiters();
     my ($error, $results, $total_hits) = SimpleSearch( $query, undef, undef, [ "authorityserver" ] );
+    if (defined $error) {
+        carp "Error:$error from search $query";
+    }
     return $results;
 }
 
 =head2 preferred_authorities
 
-=over 4
-
-my $preferred_authorities = $heading->preferred_authorities;
-
-=back
+  my $preferred_authorities = $heading->preferred_authorities;
 
 Return a list of authority records for headings
 that are a preferred form of the heading.
@@ -138,9 +127,12 @@ that are a preferred form of the heading.
 
 sub preferred_authorities {
     my $self = shift;
-    my $query = "Match-heading-see-from,ext='$self->{'search_form'}'";
+    my $query = "Match-heading-see-from,do-not-truncate,ext='$self->{'search_form'}'";
     $query .= $self->_query_limiters();
     my ($error, $results, $total_hits) = SimpleSearch( $query, undef, undef, [ "authorityserver" ] );
+    if (defined $error) {
+        carp "Error:$error from search $query";
+    }
     return $results;
 }
 
@@ -189,7 +181,7 @@ sub _marc_format_handler {
 
 =head1 AUTHOR
 
-Koha Developement team <info@koha.org>
+Koha Development Team <http://koha-community.org/>
 
 Galen Charlton <galen.charlton@liblime.com>