codefog / contao-haste

Haste is a collection of tools and classes to ease working with Contao
http://codefog.pl/extension/haste.html
MIT License
42 stars 24 forks source link

Fix checkFormFieldNameIsValid #152

Closed fritzmg closed 4 years ago

fritzmg commented 4 years ago

Currently the second check in Form::checkFormFieldNameIsValid will never be true, because it checks the name against the array content of $this->arrFormFields (which is the widget data) rather than the array keys, which are the actual form field names. So when doing

$form->addFormField('foo', […]);

$form->addFormField('foo', […]);

the latter simply overwrites the former without any error.