mirror of
https://github.com/processwire/processwire.git
synced 2025-08-22 22:34:15 +02:00
Attempt fix for issue mentioned by @Rayden in processwire/processwire-issues#1207
This commit is contained in:
@@ -771,7 +771,7 @@ class FieldtypeFile extends FieldtypeMulti implements ConfigurableModule {
|
||||
/**
|
||||
* Get match query
|
||||
*
|
||||
* @param DatabaseQuerySelect $query
|
||||
* @param DatabaseQuerySelect|PageFinderDatabaseQuerySelect $query
|
||||
* @param string $table
|
||||
* @param string $subfield
|
||||
* @param string $operator
|
||||
@@ -789,6 +789,7 @@ class FieldtypeFile extends FieldtypeMulti implements ConfigurableModule {
|
||||
$isFindOperator = $compareType & Selector::compareTypeFind;
|
||||
$isInvalidOperator = false;
|
||||
$isInvalidSubfield = false;
|
||||
$originalOperator = $operator;
|
||||
|
||||
unset($schema['keys'], $schema['xtra']);
|
||||
|
||||
@@ -838,6 +839,12 @@ class FieldtypeFile extends FieldtypeMulti implements ConfigurableModule {
|
||||
$isInvalidSubfield = true;
|
||||
}
|
||||
}
|
||||
|
||||
if($operator !== $originalOperator) {
|
||||
// operator can change above (i.e. getMatchQuerySubfield)
|
||||
$compareType = Selectors::getOperators(array('getValueType' => 'compareType', 'operator' => $operator));
|
||||
$isFindOperator = $compareType & Selector::compareTypeFind;
|
||||
}
|
||||
|
||||
if($isInvalidSubfield) {
|
||||
throw new PageFinderSyntaxException("Property '$subfield' not recognized in: $query->selector");
|
||||
|
Reference in New Issue
Block a user