[Koha-bugs] [Bug 10066] New: updating biblio return undefined error if linked authority does not exist in db

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Apr 16 18:22:29 CEST 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10066

            Bug ID: 10066
           Summary: updating biblio return undefined error if linked
                    authority does not exist in db
    Classification: Unclassified
 Change sponsored?: ---
           Product: Koha
           Version: 3.10
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P5 - low
         Component: MARC Authority data support
          Assignee: gmcharlt at gmail.com
          Reporter: siewyee2 at yahoo.com

descrption of problem:
updating biblio return undefined error if previouly linked authority does not
exist in db

steps to recreate:
1. link an authority to biblio
2. manually delete authority from db
3. either a. run link_bibs_to_authorities.pl
   or     b. update the biblio from staff client
4. will return undefined error for field

we wanted to clear all linked authorities subfield $9 from biblios. run into
this error. fixed the code, but dont really know if it is the best approach.
attaching code fix for reference.

#########################################################################

AuthoritiesMarc.pm
line 1194 added one line: return unless defined($record);

} else {
#fix undefined error if authorized heading does not exist in db
        return unless defined($record);
#
        foreach my $field ($record->field('1..')) {

##########################################################################

Biblio.pm
line 669 added one line: return unless defined($authorized_heading);

    my $authorized_heading =
      C4::AuthoritiesMarc::GetAuthorizedHeading( { 'authid' => $authid } );

#fix undefined error if authorized heading does not exist in db
   return unless defined($authorized_heading);
#

   return ($field->as_string('abcdefghijklmnopqrstuvwxyz') eq
$authorized_heading);

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list