mirror of
https://github.com/processwire/processwire.git
synced 2025-08-27 08:35:15 +02:00
Fix issue processwire/processwire-issues#1805
This commit is contained in:
@@ -1326,6 +1326,27 @@ class FieldtypePage extends FieldtypeMulti implements Module, ConfigurableModule
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the given value is considered empty or not.
|
||||
*
|
||||
* @param Field $field
|
||||
* @param mixed|Selector $value
|
||||
* @return bool
|
||||
*
|
||||
*/
|
||||
public function isEmptyValue(Field $field, $value) {
|
||||
if($value instanceof Selector && $value->field === $field->name) {
|
||||
// PageFinder is asking if we want to handle this field/value match internally
|
||||
if($value->operator === '!=' && !empty("$value->value") && !ctype_digit("$value->value")) {
|
||||
// if a page name (rather than id) is specified with a `!=` operator
|
||||
// then tell PageFinder that we handle this unique match condition internally
|
||||
// since the page name has to be converted to page ID by getMatchQuery()
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return parent::isEmptyValue($field, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the database schema in predefined format
|
||||
*
|
||||
|
Reference in New Issue
Block a user