Bug 23919: (QA follow-up) Tidy query build code

This is really opinionated, but I found this to be much cleaner to read
and thought it was worth pusing as well.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomas Cohen Arazi 2022-08-01 13:55:35 -03:00
parent cdcccc9cbe
commit fa5f643000
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 2 additions and 2 deletions

View File

@ -1416,14 +1416,14 @@ sub buildQuery {
if ( $index eq 'nb' ) {
if ( C4::Context->preference("SearchWithISBNVariations") ) {
my @isbns = C4::Koha::GetVariationsOfISBN( $operand );
$operands[$i] = $operand = '(nb=' . join(' OR nb=', @isbns) . ')';
$operands[$i] = $operand = '(' . join( ' OR ', map { 'nb=' . $_ } @isbns ) . ')';
$indexes[$i] = $index = 'kw';
}
}
if ( $index eq 'ns' ) {
if ( C4::Context->preference("SearchWithISSNVariations") ) {
my @issns = C4::Koha::GetVariationsOfISSN( $operand );
$operands[$i] = $operand = '(ns=' . join(' OR ns=', @issns) . ')';
$operands[$i] = $operand = '(' . join( ' OR ', map { 'ns=' . $_ } @issns ) . ')';
$indexes[$i] = $index = 'kw';
}
}