# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use strict;
use warnings;
my $record = GetMarcBiblio($biblionumber);
# get the coin format
+ if ( ! $record ) {
+ # can't get a valid MARC::Record object, bail out at this point
+ warn "We called GetMarcBiblio with a biblionumber that doesn't exist biblionumber=$biblionumber";
+ return;
+ }
my $pos7 = substr $record->leader(), 7, 1;
my $pos6 = substr $record->leader(), 6, 1;
my $mtx;
}
#---- "true" authorised value
- }
- elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq
- "cn_source" )
- {
- my $class_sources = GetClassSources();
- my $default_source = C4::Context->preference("DefaultClassificationSource");
- foreach my $class_source (sort keys %$class_sources) {
- next unless $class_sources->{$class_source}->{'used'} or
- ($value and $class_source eq $value) or
- ($class_source eq $default_source);
- push @authorised_values, $class_source;
- $authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'};
- }
- $value = $default_source unless ($value);
-
- #---- "true" authorised value
} else {
$authorised_values_sth->execute( $tagslib->{$tag}->{$subfield}->{authorised_value} );
push @authorised_values, ""