mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 17:54:44 +02:00
Add feature request processwire/processwire-requests#479
This commit is contained in:
@@ -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
|
// the following fields are defined in each iteration here because they may be modified in the loop
|
||||||
$table = "pages";
|
$table = "pages";
|
||||||
$operator = $selector->operator;
|
$operator = $selector->operator;
|
||||||
|
$not = $selector->not;
|
||||||
$compareType = $selectors::getSelectorByOperator($operator, 'compareType');
|
$compareType = $selectors::getSelectorByOperator($operator, 'compareType');
|
||||||
$isPartialOperator = ($compareType & Selector::compareTypeFind);
|
$isPartialOperator = ($compareType & Selector::compareTypeFind);
|
||||||
|
|
||||||
@@ -2757,8 +2758,14 @@ class PageFinder extends Wire {
|
|||||||
$field = $subfield;
|
$field = $subfield;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if($field === 'id' && count($values) > 1 && $operator === '=' && !$selector->not) {
|
} else if($field === 'id' && count($values) > 1) {
|
||||||
$IDs = $values;
|
if($operator === '=') {
|
||||||
|
$IDs = $values;
|
||||||
|
} else if($operator === '!=' && !$not) {
|
||||||
|
$not = true;
|
||||||
|
$operator = '=';
|
||||||
|
$IDs = $values;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// primary field is not 'parent', 'children' or 'pages'
|
// primary field is not 'parent', 'children' or 'pages'
|
||||||
@@ -2766,7 +2773,7 @@ class PageFinder extends Wire {
|
|||||||
|
|
||||||
if(count($IDs)) {
|
if(count($IDs)) {
|
||||||
// parentIDs or IDs found via another query, and we don't need to match anything other than the parent ID
|
// 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 ";
|
$sql .= in_array($field, array('parent', 'parent_id')) ? "$table.parent_id " : "$table.id ";
|
||||||
$IDs = $sanitizer->intArray($IDs);
|
$IDs = $sanitizer->intArray($IDs);
|
||||||
$strIDs = implode(',', $IDs);
|
$strIDs = implode(',', $IDs);
|
||||||
|
Reference in New Issue
Block a user