Project

General

Profile

Actions

Bug #14237

closed

Flexforms don't show default values

Added by old_gmarsal almost 20 years ago. Updated over 17 years ago.

Status:
Closed
Priority:
Should have
Category:
Backend API
Target version:
-
Start date:
2004-07-14
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.8.0
PHP Version:
4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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>

&lt;hostname&gt;
&lt;TCEforms&gt;
&lt;label&gt;ldap server hostname :&lt;/label&gt;
&lt;config&gt;
&lt;type&gt;input&lt;/type&gt;
&lt;size&gt;30&lt;/size&gt;
&lt;default&gt;ldap.mydomain&lt;/default&gt;
&lt;eval&gt;required,nospace&lt;/eval&gt;
&lt;/config&gt;
&lt;/TCEforms&gt;
&lt;/hostname&gt;
&lt;port&gt;
&lt;TCEforms&gt;
&lt;label&gt;ldap server port :&lt;/label&gt;
&lt;config&gt;
&lt;type&gt;input&lt;/type&gt;
&lt;size&gt;10&lt;/size&gt;
&lt;default&gt;389&lt;/default&gt;
&lt;eval&gt;required,int&lt;/eval&gt;
&lt;/config&gt;
&lt;/TCEforms&gt;
&lt;/port&gt;
&lt;binduser&gt;
&lt;TCEforms&gt;
&lt;label&gt;bind user :&lt;/label&gt;
&lt;config&gt;
&lt;type&gt;input&lt;/type&gt;
&lt;size&gt;30&lt;/size&gt;
&lt;eval&gt;trim&lt;/eval&gt;
&lt;/config&gt;
&lt;/TCEforms&gt;
&lt;/binduser&gt;
&lt;bindpass&gt;
&lt;TCEforms&gt;
&lt;label&gt;bind password :&lt;/label&gt;
&lt;config&gt;
&lt;type&gt;input&lt;/type&gt;
&lt;size&gt;30&lt;/size&gt;
&lt;eval&gt;trim,password&lt;/eval&gt;
&lt;/config&gt;
&lt;/TCEforms&gt;
&lt;/bindpass&gt;
&lt;/el&gt;
&lt;/ROOT&gt;
&lt;/sDEF&gt;
&lt;/sheets&gt;
&lt;/T3DataStructure&gt;
(issue imported from #M214)

Files

class.t3lib_tceforms.214.patch (1.02 KB) class.t3lib_tceforms.214.patch Administrator Admin, 2005-05-19 19:15
Actions #1

Updated by Steffen Müller over 19 years ago

Hi.
I need that fixed. :)
Could you please report a statement if this issue will be fixed at all.

Actions #2

Updated by Jean-David Gadina about 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...

Actions #3

Updated by Michael Scharkow about 19 years ago

Apart from the backdraw of non-empty fields, this doesn't work for me.

Actions #4

Updated by old_jwitt about 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

Actions #5

Updated by Karsten Dambekalns about 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

Actions #6

Updated by Karsten Dambekalns almost 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!

Actions #7

Updated by Karsten Dambekalns over 18 years ago

The patch has been added to CVS.

Actions

Also available in: Atom PDF