1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 18:24:57 +02:00
This commit is contained in:
Ryan Cramer
2023-09-29 15:09:30 -04:00
parent d68c782c8d
commit 4355654d16
2 changed files with 11 additions and 7 deletions

View File

@@ -1337,11 +1337,15 @@ class FieldtypePage extends FieldtypeMulti implements Module, ConfigurableModule
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;
if($value->operator === '!=') {
$v = $value->value;
if(is_array($v)) $v = implode('', $v);
if(!empty("$v") && !ctype_digit("$v")) {
// 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);

View File

@@ -332,8 +332,8 @@ class InputfieldPassword extends InputfieldText {
if(!isset($input->$key)) return $this;
// form was submitted
$pass = $input->$key;
$confirmPass = $input->$confirmKey;
$pass = (string) $input->$key;
$confirmPass = (string) $input->$confirmKey;
if(strlen($pass) && strlen($confirmPass)) {
// password was submitted (with confirmation)