From 4355654d16dffef564f6db7d32ef9543ff84ba51 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 29 Sep 2023 15:09:30 -0400 Subject: [PATCH] Updates for processwire/processwire-issues#1467 --- wire/modules/Fieldtype/FieldtypePage.module | 14 +++++++++----- .../InputfieldPassword/InputfieldPassword.module | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/wire/modules/Fieldtype/FieldtypePage.module b/wire/modules/Fieldtype/FieldtypePage.module index d4ddb89a..9c62645a 100644 --- a/wire/modules/Fieldtype/FieldtypePage.module +++ b/wire/modules/Fieldtype/FieldtypePage.module @@ -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); diff --git a/wire/modules/Inputfield/InputfieldPassword/InputfieldPassword.module b/wire/modules/Inputfield/InputfieldPassword/InputfieldPassword.module index 46f1abe4..92f16430 100644 --- a/wire/modules/Inputfield/InputfieldPassword/InputfieldPassword.module +++ b/wire/modules/Inputfield/InputfieldPassword/InputfieldPassword.module @@ -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)