Don't remove cnj on first term in Query. We might reorder them later.
parent
e0c5382825
commit
fa844e60cb
|
@ -184,10 +184,11 @@ class Filter extends ZM_Object {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->{'Query'} and isset($this->{'Query'}['terms']) and count($this->{'Query'}['terms'])) {
|
# Disable this. We will do this on SQL generation
|
||||||
# Unset cnj on first term, so that there's no leading AND
|
#if ($this->{'Query'} and isset($this->{'Query'}['terms']) and count($this->{'Query'}['terms'])) {
|
||||||
unset($this->{'Query'}['terms'][0]['cnj']);
|
## Unset cnj on first term, so that there's no leading AND
|
||||||
}
|
#unset($this->{'Query'}['terms'][0]['cnj']);
|
||||||
|
#}
|
||||||
return $this->{'Query'};
|
return $this->{'Query'};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1177,6 +1178,9 @@ class Filter extends ZM_Object {
|
||||||
foreach ($sort as $attr) {
|
foreach ($sort as $attr) {
|
||||||
for ($i=0; $i < count($old_terms); $i++) {
|
for ($i=0; $i < count($old_terms); $i++) {
|
||||||
if ($old_terms[$i]['attr'] == $attr) {
|
if ($old_terms[$i]['attr'] == $attr) {
|
||||||
|
if (!isset($old_terms[$i]['cnj'])) {
|
||||||
|
$old_terms[$i]['cnj'] = 'and';
|
||||||
|
}
|
||||||
$new_terms[] = $old_terms[$i];
|
$new_terms[] = $old_terms[$i];
|
||||||
array_splice($old_terms, $i, 1);
|
array_splice($old_terms, $i, 1);
|
||||||
$i--;
|
$i--;
|
||||||
|
|
Loading…
Reference in New Issue