mirror of
https://github.com/processwire/processwire.git
synced 2025-08-20 21:42:23 +02:00
Fix issue processwire/processwire-issues#1349
This commit is contained in:
@@ -1728,6 +1728,7 @@ class PageFinder extends Wire {
|
||||
$joinType = 'join';
|
||||
|
||||
if(count($fields) > 1
|
||||
|| !empty($options['startAfterID']) || !empty($options['stopBeforeID'])
|
||||
|| (count($valueArray) > 1 && $numEmptyValues > 0)
|
||||
|| ($subfield == 'count' && !$this->isRepeaterFieldtype($field->type))
|
||||
|| ($selector->not && $selector->operator != '!=')
|
||||
@@ -1796,6 +1797,17 @@ class PageFinder extends Wire {
|
||||
$this->getQuerySortSelector($query, $s);
|
||||
}
|
||||
}
|
||||
|
||||
if((!empty($options['startAfterID']) || !empty($options['stopBeforeID'])) && count($query->where)) {
|
||||
$wheres = array('(' . implode(' AND ', $query->where) . ')');
|
||||
$query->set('where', array());
|
||||
foreach(array('startAfterID', 'stopBeforeID') as $key) {
|
||||
if(empty($options[$key])) continue;
|
||||
$bindKey = $query->bindValueGetKey($options[$key], \PDO::PARAM_INT);
|
||||
array_unshift($wheres, "pages.id=$bindKey");
|
||||
}
|
||||
$query->where(implode("\n OR ", $wheres));
|
||||
}
|
||||
|
||||
$this->postProcessQuery($query);
|
||||
$this->finalSelectors = $selectors;
|
||||
|
Reference in New Issue
Block a user