Lines 1318-1323
sub _SearchItems_build_where_fragment {
Link Here
|
1318 |
if ( (0 < grep { $_ eq $field } @columns) or (substr($field, 0, 5) eq 'marc:') ) { |
1318 |
if ( (0 < grep { $_ eq $field } @columns) or (substr($field, 0, 5) eq 'marc:') ) { |
1319 |
my $op = $filter->{operator}; |
1319 |
my $op = $filter->{operator}; |
1320 |
my $query = $filter->{query}; |
1320 |
my $query = $filter->{query}; |
|
|
1321 |
my $ifnull = $filter->{ifnull}; |
1321 |
|
1322 |
|
1322 |
if (!$op or (0 == grep { $_ eq $op } @operators)) { |
1323 |
if (!$op or (0 == grep { $_ eq $op } @operators)) { |
1323 |
$op = '='; # default operator |
1324 |
$op = '='; # default operator |
Lines 1358-1363
sub _SearchItems_build_where_fragment {
Link Here
|
1358 |
$column = $field; |
1359 |
$column = $field; |
1359 |
} |
1360 |
} |
1360 |
|
1361 |
|
|
|
1362 |
if ( defined $ifnull ) { |
1363 |
$column = "IFNULL($column, ?)"; |
1364 |
} |
1365 |
|
1361 |
if (ref $query eq 'ARRAY') { |
1366 |
if (ref $query eq 'ARRAY') { |
1362 |
if ($op eq '=') { |
1367 |
if ($op eq '=') { |
1363 |
$op = 'IN'; |
1368 |
$op = 'IN'; |
Lines 1374-1379
sub _SearchItems_build_where_fragment {
Link Here
|
1374 |
args => [ $query ], |
1379 |
args => [ $query ], |
1375 |
}; |
1380 |
}; |
1376 |
} |
1381 |
} |
|
|
1382 |
|
1383 |
if ( defined $ifnull ) { |
1384 |
unshift @{ $where_fragment->{args} }, $ifnull; |
1385 |
} |
1377 |
} |
1386 |
} |
1378 |
} |
1387 |
} |
1379 |
|
1388 |
|