You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently value of hidden field is always casted to string, even if value is null. I would like to propose to allow null value or cast value to integer/float etc if there are defined validation rules.
forms/src/Forms/Controls/HiddenField.php:
public function setValue($value)
{
if (!is_scalar($value) && $value !== NULL && !method_exists($value, '__toString')) {
throw new Nette\InvalidArgumentException(sprintf("Value must be scalar or NULL, %s given in field '%s'.", gettype($value), $this->name));
}
if (!$this->persistValue) {
$this->value = (string) $value;
}
return $this;
}
The text was updated successfully, but these errors were encountered:
Description
Currently value of hidden field is always casted to string, even if value is null. I would like to propose to allow null value or cast value to integer/float etc if there are defined validation rules.
forms/src/Forms/Controls/HiddenField.php:
The text was updated successfully, but these errors were encountered: