1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 18:24:57 +02:00

Fix behavior of PageFinder when selector has multiple fields before a != operator and no values after the operator, i.e. a|b|c!=

This commit is contained in:
Ryan Cramer
2024-03-15 15:50:12 -04:00
parent d7502b669a
commit 38757b1baa
2 changed files with 4 additions and 4 deletions

View File

@@ -2146,7 +2146,9 @@ class PageFinder extends Wire {
} else if($operator === '!=' || $operator === '<>') {
// not equals
$whereType = 'AND';
$whereType = count($selector->fields()) > 1 && $ft->isEmptyValue($field, $value) ? 'OR' : 'AND';
// alternate and technically more consistent behavior, but doesn't seem useful:
// $whereType = count($selector->fields()) > 1 ? 'OR' : 'AND';
$zeroIsEmpty = $ft->isEmptyValue($field, "0");
$zeroIsNotEmpty = !$zeroIsEmpty;
$value = (string) $value;

View File

@@ -360,8 +360,7 @@ abstract class ProcessPageListRender extends Wire {
}
if(!empty($options['noTags']) && strpos($value, '<') !== false) {
// legacy code, appears to be impossible to reach
$value = strip_tags($value);
$value = strip_tags(str_replace('<', ' <', $value));
}
return $icon . trim($value);
@@ -573,4 +572,3 @@ abstract class ProcessPageListRender extends Wire {
}
}