mirror of
https://github.com/processwire/processwire.git
synced 2025-08-13 18:24:57 +02:00
Updates for processwire/processwire-issues#1467
This commit is contained in:
@@ -1337,11 +1337,15 @@ class FieldtypePage extends FieldtypeMulti implements Module, ConfigurableModule
|
|||||||
public function isEmptyValue(Field $field, $value) {
|
public function isEmptyValue(Field $field, $value) {
|
||||||
if($value instanceof Selector && $value->field === $field->name) {
|
if($value instanceof Selector && $value->field === $field->name) {
|
||||||
// PageFinder is asking if we want to handle this field/value match internally
|
// PageFinder is asking if we want to handle this field/value match internally
|
||||||
if($value->operator === '!=' && !empty("$value->value") && !ctype_digit("$value->value")) {
|
if($value->operator === '!=') {
|
||||||
// if a page name (rather than id) is specified with a `!=` operator
|
$v = $value->value;
|
||||||
// then tell PageFinder that we handle this unique match condition internally
|
if(is_array($v)) $v = implode('', $v);
|
||||||
// since the page name has to be converted to page ID by getMatchQuery()
|
if(!empty("$v") && !ctype_digit("$v")) {
|
||||||
return true;
|
// 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 parent::isEmptyValue($field, $value);
|
||||||
|
@@ -332,8 +332,8 @@ class InputfieldPassword extends InputfieldText {
|
|||||||
if(!isset($input->$key)) return $this;
|
if(!isset($input->$key)) return $this;
|
||||||
|
|
||||||
// form was submitted
|
// form was submitted
|
||||||
$pass = $input->$key;
|
$pass = (string) $input->$key;
|
||||||
$confirmPass = $input->$confirmKey;
|
$confirmPass = (string) $input->$confirmKey;
|
||||||
|
|
||||||
if(strlen($pass) && strlen($confirmPass)) {
|
if(strlen($pass) && strlen($confirmPass)) {
|
||||||
// password was submitted (with confirmation)
|
// password was submitted (with confirmation)
|
||||||
|
Reference in New Issue
Block a user