Bug #18042

Selected value of select field not shown in TCEforms

Added by Robert Destigter almost 13 years ago. Updated over 7 years ago.

Should have
FormEngine aka TCEforms
Target version:
Start date:
Due date:
% Done:


Estimated time:
TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


I am having trouble with display selected values in a form field of type "select" within a flexform.

The XML defination of the field in my DS is as follows:

<my_field type="array">
<tx_templavoila type="array">
<title>My field</title>
<TCEforms type="array">
<config type="array">
<label>My field</label>

The field is displayed correctly with the items passed on with "itemsProcFunc". The selected values are even saved in the XML in the database. I checked that with the option "View: Flexform XML", but the options of the selectbox aren't set as selected after saving.

I also tried the option "<renderMode>checkbox</renderMode>", but even than the selected options aren't checked after saving.


(issue imported from #M7248)


class.t3lib_transferdata.php.diff (827 Bytes) class.t3lib_transferdata.php.diff Administrator Admin, 2008-10-09 16:08

Updated by Robert Destigter almost 13 years ago

Sorry, I accidently submitted before thinking of a good subject. Severity also should be set to major. Could some admin please change this for me?


Updated by Robert Destigter almost 13 years ago

So far I have been able to debug it back to the function "renderRecord_selectProc" of the class "t3lib_transferData"


Updated by Robert Destigter almost 13 years ago

The problem has to do with the function "renderRecord_selectProc" of the class "t3lib_transferData".

Because the items array of the field is declared with XML and not set as an empty array by php the function bypasses the step where it loops through the variable $elements.

I solved it with a workaround by changing "<items></items>" into:

<numIndex index="0"></numIndex>

What is the correct way for this?


Updated by Oliver Hader almost 13 years ago

Changed the subject of this issue. It's not a major one.
Thanks for tracking down the origin. This would also mean, that an empty items array in regular TCA context produces this behaviour, wouldn't it?


Updated by Steffen Kamper almost 13 years ago

remove <items></items> or if you need an empty item at the beginning use
<numIndex index="0" type="array">
<numIndex index="0"></numIndex>
<numIndex index="1"></numIndex>


Updated by Robert Destigter almost 13 years ago

Thanks for the info. It worked.

That is correct. I tested the configuration for a regular TCA field defined in PHP. If the index "items" is not declared or if it is not declared as an array, the selected values are submitted to the database, but not displayed as selected after saving or editing the record.

I also tested it in combination with a "foreign_table" configuration. In that case the selected records are displayed as selected, but the selected dynamic options added with "itemsProcFunc" are not.


Updated by Robert Destigter almost 13 years ago

The renderMode configuration does not have influence on this issue.

My conclusion is: If the "items" index is not an array, selected values added with itemsProcFunc are submitted to the database, but not displayed as selected in the form.


Updated by Stefan Geith almost 13 years ago

I think, the same behaviour can be seen in tt_news:

When you place the tt_news plugin, you can select a category form the recursive category-tree via 'Category selection' :
but when you re-edit the record, the selection is gone.

If you select 'Special options: [not categorized]' (what is defined in the flexforms items-array) it apears correctly on re-editing.


Updated by Netresearch GmbH & Co KG about 12 years ago

The problem lies in class.t3lib_transferdata.php:423(function renderRecord_selectProc)

// Add regular elements:
if (is_array($fieldConfig['config']['items'])) {
$fieldConfig['config']['items'] = $this->procesItemArray($fieldConfig['config']['items'], $fieldConfig['config'], $TSconfig[$field], $table, $row, $field);
foreach($fieldConfig['config']['items'] as $pvpv) {

That means only if an item array exists, the dynamic items from itemProcFunction will be added. But that way is false.

A Workaround for that is:

<config type="array">
<items type="array">


Updated by Netresearch GmbH & Co KG about 12 years ago

The patch is against Typo3 4.2.1


Updated by Christian Weiske almost 11 years ago

Could someone apply this patch to 4.2.x and check if that is still relevant for 4.3? This is a really, really annoying problem.


Updated by Andreas Wolf about 9 years ago

  • Category set to FormEngine aka TCEforms
  • Status changed from New to Needs Feedback
  • Target version deleted (0)
  • Complexity set to easy

Could anyone provide a test extension for that? And test if that's still relevant in 4.5/4.6?


Updated by Alexander Opitz over 7 years ago

  • Status changed from Needs Feedback to Closed

No response over one year => closed.

Also available in: Atom PDF