View | Details | Raw Unified | Return to bug 14627
Collapse All | Expand All

(-)a/C4/Koha.pm (-3 / +9 lines)
Lines 1342-1350 sub GetAuthorisedValueByCode { Link Here
1342
    }
1342
    }
1343
1343
1344
    my $field = $opac ? 'lib_opac' : 'lib';
1344
    my $field = $opac ? 'lib_opac' : 'lib';
1345
    my @params;
1345
    my $dbh = C4::Context->dbh;
1346
    my $dbh = C4::Context->dbh;
1346
    my $sth = $dbh->prepare("SELECT $field FROM authorised_values WHERE category=? AND authorised_value =?");
1347
    my $sql = "SELECT $field FROM authorised_values WHERE authorised_value =?";
1347
    $sth->execute( $category, $authvalcode );
1348
    push @params, $authvalcode;
1349
    if (defined $category) {
1350
        $sql .= ' AND category=?';
1351
        push @params, $category;
1352
    }
1353
    my $sth = $dbh->prepare($sql);
1354
    $sth->execute( @params );
1348
    while ( my $data = $sth->fetchrow_hashref ) {
1355
    while ( my $data = $sth->fetchrow_hashref ) {
1349
        return $data->{ $field };
1356
        return $data->{ $field };
1350
    }
1357
    }
1351
- 

Return to bug 14627