projects
/
koha-ffzg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug 9755 QA follow-up: move MARC-specific functionality to utility class
[koha-ffzg.git]
/
Koha
/
Authority.pm
diff --git
a/Koha/Authority.pm
b/Koha/Authority.pm
index
855ce1f
..
509fe3f
100644
(file)
--- a/
Koha/Authority.pm
+++ b/
Koha/Authority.pm
@@
-38,9
+38,9
@@
use MARC::Record;
use MARC::File::XML;
use C4::Charset;
use MARC::File::XML;
use C4::Charset;
-use base qw(Koha::Record);
+use base qw(Koha::
Metadata
Record);
-__PACKAGE__->mk_accessors(qw( authid authtype
marcflavour
));
+__PACKAGE__->mk_accessors(qw( authid authtype ));
=head2 new
=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.
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;
=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=?");
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,
$record->encoding('UTF-8');
my $self = $class->SUPER::new( { authid => $authid,
- marcflavour => $marcflavour,
authtype => $authtypecode,
authtype => $authtypecode,
+ schema => $marcflavour,
record => $record });
bless $self, $class;
record => $record });
bless $self, $class;