1
0
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:
Ryan Cramer
2020-07-09 11:06:19 -04:00
parent f095f4aa77
commit f7879126da

View File

@@ -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");