X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;ds=sidebyside;f=Koha%2FAuthority.pm;h=509fe3fad91de97c8c21329598cf9d6d1948213b;hb=56ea0f7e0fc91d46e98f94ff9f3f87eb12b82c8b;hp=855ce1f5c69299589e182a8ad0cc660d2a666355;hpb=50fb4612ed573dd180c5e98e7d6e83c4265817f0;p=koha-ffzg.git diff --git a/Koha/Authority.pm b/Koha/Authority.pm index 855ce1f5c6..509fe3fad9 100644 --- a/Koha/Authority.pm +++ b/Koha/Authority.pm @@ -38,9 +38,9 @@ use MARC::Record; use MARC::File::XML; use C4::Charset; -use base qw(Koha::Record); +use base qw(Koha::MetadataRecord); -__PACKAGE__->mk_accessors(qw( authid authtype marcflavour )); +__PACKAGE__->mk_accessors(qw( authid authtype )); =head2 new @@ -65,12 +65,15 @@ sub new { my $auth = Koha::Authority->get_from_authid($authid); Create the Koha::Authority object associated with the provided authid. +Note that this routine currently retrieves a MARC record because +authorities in Koha are MARC records by definition. This is an +unfortunate but unavoidable fact. =cut sub get_from_authid { my $class = shift; my $authid = shift; - my $marcflavour = C4::Context->preference("marcflavour"); + my $marcflavour = lc C4::Context->preference("marcflavour"); my $dbh=C4::Context->dbh; my $sth=$dbh->prepare("select authtypecode, marcxml from auth_header where authid=?"); @@ -82,8 +85,8 @@ sub get_from_authid { $record->encoding('UTF-8'); my $self = $class->SUPER::new( { authid => $authid, - marcflavour => $marcflavour, authtype => $authtypecode, + schema => $marcflavour, record => $record }); bless $self, $class;