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

(-)a/C4/Koha.pm (-3 / +9 lines)
Lines 1262-1270 sub GetAuthorisedValueByCode { Link Here
1262
    }
1262
    }
1263
1263
1264
    my $field = $opac ? 'lib_opac' : 'lib';
1264
    my $field = $opac ? 'lib_opac' : 'lib';
1265
    my @params;
1265
    my $dbh = C4::Context->dbh;
1266
    my $dbh = C4::Context->dbh;
1266
    my $sth = $dbh->prepare("SELECT $field FROM authorised_values WHERE category=? AND authorised_value =?");
1267
    my $sql = "SELECT $field FROM authorised_values WHERE authorised_value =?";
1267
    $sth->execute( $category, $authvalcode );
1268
    push @params, $authvalcode;
1269
    if (defined $category) {
1270
        $sql .= ' AND category=?';
1271
        push @params, $category;
1272
    }
1273
    my $sth = $dbh->prepare($sql);
1274
    $sth->execute( @params );
1268
    while ( my $data = $sth->fetchrow_hashref ) {
1275
    while ( my $data = $sth->fetchrow_hashref ) {
1269
        return $data->{ $field };
1276
        return $data->{ $field };
1270
    }
1277
    }
1271
- 

Return to bug 14627