1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 16:26:59 +02:00
This commit is contained in:
Ryan Cramer
2023-02-14 11:29:57 -05:00
parent c3b9c72df9
commit 104c1cddbe

View File

@@ -2667,6 +2667,7 @@ class PageFinder extends Wire {
// the following fields are defined in each iteration here because they may be modified in the loop
$table = "pages";
$operator = $selector->operator;
$not = $selector->not;
$compareType = $selectors::getSelectorByOperator($operator, 'compareType');
$isPartialOperator = ($compareType & Selector::compareTypeFind);
@@ -2757,8 +2758,14 @@ class PageFinder extends Wire {
$field = $subfield;
}
}
} else if($field === 'id' && count($values) > 1 && $operator === '=' && !$selector->not) {
} else if($field === 'id' && count($values) > 1) {
if($operator === '=') {
$IDs = $values;
} else if($operator === '!=' && !$not) {
$not = true;
$operator = '=';
$IDs = $values;
}
} else {
// primary field is not 'parent', 'children' or 'pages'
@@ -2766,7 +2773,7 @@ class PageFinder extends Wire {
if(count($IDs)) {
// parentIDs or IDs found via another query, and we don't need to match anything other than the parent ID
$in = $selector->not ? "NOT IN" : "IN";
$in = $not ? "NOT IN" : "IN";
$sql .= in_array($field, array('parent', 'parent_id')) ? "$table.parent_id " : "$table.id ";
$IDs = $sanitizer->intArray($IDs);
$strIDs = implode(',', $IDs);