ChoiceControl::getRawValue(): Return value must be of type string|int, null returned
forgie1 opened this issue · comments
Version: 3.2.0
Bug Description
BaseControl::$value
may be null, so ChoiceControl::getRawValue()
should return also null
.
SelectBox::$value
may be null if SelectBox was disabled (e.g. conditionally).
$form = new Nette\Application\UI\Form();
$form->addSelect('xyz', 'Xyz', ['X' =>'x', 'Y' => 'y'])->setDisabled();
$form->onSuccess[] = function (Nette\Application\UI\Form $form) {
$form['xyz']->getRawValue();
};
fixed 9b82572