Bug #14237
closedFlexforms don't show default values
0%
Description
I have configured some default values in my flexforms. They aren't shown when i load the form. I have configured some fields with <eval>required</eval> and this doesn't work too.
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LDAP SERVER</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<hostname>
<TCEforms>
<label>ldap server hostname :</label>
<config>
<type>input</type>
<size>30</size>
<default>ldap.mydomain</default>
<eval>required,nospace</eval>
</config>
</TCEforms>
</hostname>
<port>
<TCEforms>
<label>ldap server port :</label>
<config>
<type>input</type>
<size>10</size>
<default>389</default>
<eval>required,int</eval>
</config>
</TCEforms>
</port>
<binduser>
<TCEforms>
<label>bind user :</label>
<config>
<type>input</type>
<size>30</size>
<eval>trim</eval>
</config>
</TCEforms>
</binduser>
<bindpass>
<TCEforms>
<label>bind password :</label>
<config>
<type>input</type>
<size>30</size>
<eval>trim,password</eval>
</config>
</TCEforms>
</bindpass>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
(issue imported from #M214)
Files
Updated by Steffen Müller almost 20 years ago
Hi.
I need that fixed. :)
Could you please report a statement if this issue will be fixed at all.
Updated by Jean-David Gadina over 19 years ago
There is a problem at line 615 of class.t3lib_transferdata.php:
00615 if (!isset($dataValues[$key][$vKey])) { 00616 $dataValues[$key][$vKey] = $dsConf['TCEforms']['config']['default']; 00617 }
This place the default values in the FlexForms, if an existing value does not exist. The problem is that, when you save your form, Typo3 will write an empty <vDEF> tag in the XML structure, preventing the default value to show...
If you change the line 615 like that, for instance:
00615 if (empty($dataValues[$key][$vKey])) {
The default value will now show, unless something else is written. But it will become impossible to have an empty value.
Hope this will help...
Updated by Michael Scharkow over 19 years ago
Apart from the backdraw of non-empty fields, this doesn't work for me.
Updated by old_jwitt over 19 years ago
I fixed this problem in class.t3lib_tceforms.php at line 2153:
$fakePA['itemFormElValue']=$editData[$key][$vDEFkey];
with this:
if(isset($editData[$key][$vDEFkey]))
$fakePA['itemFormElValue']=$editData[$key][$vDEFkey];
else
$fakePA['itemFormElValue']=$fakePA['fieldConf']['config']['default'];
empty values are possible and the default values are shown
Updated by Karsten Dambekalns over 19 years ago
Did/could you check whether the fix works for 3.8.0beta2.1 as well?
It works, The line to be replaced is now at linenumber 2162 of
class.t3lib_tceforms.php though....
Ries
Updated by Karsten Dambekalns over 19 years ago
The suggested change to fix this has been added as a patch. This has been confirmed to work, but could someone else check this quickly? Thanks!
Updated by Karsten Dambekalns about 19 years ago
The patch has been added to CVS.