1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-10 16:54:44 +02:00
This commit is contained in:
Ryan Cramer
2025-07-01 10:45:29 -04:00
parent f4487628ad
commit 3770a8f74b

View File

@@ -519,7 +519,7 @@ abstract class Inputfield extends WireData implements Module {
if($value === true) $value = self::collapsedYes; if($value === true) $value = self::collapsedYes;
$value = (int) $value; $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); return $this->setAttribute($key, $value);
} else if($key === 'required' && $value && !is_object($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) { protected function ___callUnknown($method, $arguments) {
$arg = isset($arguments[0]) ? $arguments[0] : null; $arg = isset($arguments[0]) ? $arguments[0] : null;
if(isset($this->attributes[$method])) { if(isset($this->attributes[$method]) && $method !== 'required') {
// get or set an attribute // get or set an attribute
return $arg === null ? $this->getAttribute($method) : $this->setAttribute($method, $arg); return $arg === null ? $this->getAttribute($method) : $this->setAttribute($method, $arg);
} else if(($value = $this->getSetting($method)) !== null) { } else if(($value = $this->getSetting($method)) !== null) {