Bug 8829: Fix authority importing

A subroutine was not being imported by C4::ImportBatch (ironic, no?)
so this patch makes the call fully-qualified. This patch also cleans
up two warnings in C4::Auth that are raised when logged in as the
database user.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
Jared Camins-Esakov 2012-09-26 16:33:15 -04:00 committed by Paul Poulain
parent b769a3cda0
commit e883a0f065
2 changed files with 10 additions and 4 deletions

View file

@ -657,7 +657,7 @@ sub checkauth {
$ip = $session->param('ip');
$lasttime = $session->param('lasttime');
$userid = $session->param('id');
$sessiontype = $session->param('sessiontype');
$sessiontype = $session->param('sessiontype') || '';
}
if ( ( ($query->param('koha_login_context')) && ($query->param('userid') ne $session->param('id')) )
|| ( $cas && $query->param('ticket') ) ) {
@ -1495,7 +1495,13 @@ sub getuserflags {
my $userid = shift;
my $dbh = @_ ? shift : C4::Context->dbh;
my $userflags;
$flags = 0 unless $flags;
{
# I don't want to do this, but if someone logs in as the database
# user, it would be preferable not to spam them to death with
# numeric warnings. So, we make $flags numeric.
no warnings 'numeric';
$flags += 0;
}
my $sth = $dbh->prepare("SELECT bit, flag, defaulton FROM userflags");
$sth->execute;

View file

@ -1306,7 +1306,7 @@ sub GetImportRecordMatches {
$sth->execute();
while (my $row = $sth->fetchrow_hashref) {
if ($row->{'record_type'} eq 'auth') {
$row->{'authorized_heading'} = GetAuthorizedHeading( { authid => $row->{'candidate_match_id'} } );
$row->{'authorized_heading'} = C4::AuthoritiesMarc::GetAuthorizedHeading( { authid => $row->{'candidate_match_id'} } );
}
next if ($row->{'record_type'} eq 'biblio' && not $row->{'biblionumber'});
push @$results, $row;
@ -1375,7 +1375,7 @@ sub _add_auth_fields {
if ($marc_record->field('001')) {
$controlnumber = $marc_record->field('001')->data();
}
my $authorized_heading = GetAuthorizedHeading({ record => $marc_record });
my $authorized_heading = C4::AuthoritiesMarc::GetAuthorizedHeading({ record => $marc_record });
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare("INSERT INTO import_auths (import_record_id, control_number, authorized_heading) VALUES (?, ?, ?)");
$sth->execute($import_record_id, $controlnumber, $authorized_heading);