From 3770a8f74bb6b2d55619fd623ea00e832f18f308 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Tue, 1 Jul 2025 10:45:29 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#2074 --- wire/core/Inputfield.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wire/core/Inputfield.php b/wire/core/Inputfield.php index 8e9f4e21..e39a8c60 100644 --- a/wire/core/Inputfield.php +++ b/wire/core/Inputfield.php @@ -519,7 +519,7 @@ abstract class Inputfield extends WireData implements Module { if($value === true) $value = self::collapsedYes; $value = (int) $value; - } else if(array_key_exists($key, $this->attributes)) { + } else if(array_key_exists($key, $this->attributes) && $key !== 'required') { return $this->setAttribute($key, $value); } else if($key === 'required' && $value && !is_object($value)) { @@ -950,7 +950,7 @@ abstract class Inputfield extends WireData implements Module { */ protected function ___callUnknown($method, $arguments) { $arg = isset($arguments[0]) ? $arguments[0] : null; - if(isset($this->attributes[$method])) { + if(isset($this->attributes[$method]) && $method !== 'required') { // get or set an attribute return $arg === null ? $this->getAttribute($method) : $this->setAttribute($method, $arg); } else if(($value = $this->getSetting($method)) !== null) {