codefog / contao-haste

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

FormExplanation and the getAttributesFromDca function #83

Closed stefanheimes closed 8 years ago

stefanheimes commented 8 years ago

Hi,

i have a problem with the Form::addFormField function. (https://github.com/codefog/contao-haste/blob/master/library/Haste/Form/Form.php#L363)

If I use the FormExplanation Widget, the field need a text value in the dca but in this line: https://github.com/codefog/contao-haste/blob/master/library/Haste/Form/Form.php#L450 you use the getAttributesFromDca which removes this field from the dca. So the FormExplanation won't get the text value.

A solution would be to merge the result from the $strClass::getAttributesFromDca and the current $arrDca.

stefanheimes commented 8 years ago

Maybe it is a missing function in the contao/core getAttributesFromDca function. But i am not sure.

Toflar commented 8 years ago

The code should look like this:

'eval' => ['text' => 'Text explanation']
stefanheimes commented 8 years ago

You are right. Thx.