Issue Bug Closed

#19122The option "autoSizeMax" is not applied to a record selector.

Jochen Rau 07/17/08, 20:53 updated 09/09/13, 09:14

Description

In the $TCA you can set the configuration option “autoSizeMax” to create “self-adapting” selector boxes. The record selector of IRRE does not consider the given value.

This bug is caused by the following line in which the variable $itemArray is not set (=0):

$size = $conf[‘autoSizeMax’] ? t3lib_div::intInRange(count($itemArray)+1,t3lib_div::intInRange($size,1),$conf[‘autoSizeMax’]) : $size;

IMO it should be

$size = $conf[‘autoSizeMax’] ? t3lib_div::intInRange(count($selItems) – count($uniqueIds) + 1, t3lib_div::intInRange($size, 1), $conf[‘autoSizeMax’]) : $size;

An example configuration of a field:

‘my_field’ => Array (
‘label’ => ‘The Label’,
‘config’ => Array (
‘type’ => ‘inline’,
‘foreign_table’ => ‘tx_foreign_table’,
‘foreign_field’ => ‘component_id’,
‘foreign_sortby’ => ‘component_sort’,
‘foreign_label’ => ‘subcomponent_id’,
‘foreign_selector’ => ‘subcomponent_id’,
‘foreign_unique’ => ‘subcomponent_id’,
‘minitems’ => 0,
‘maxitems’ => 999,
‘size’ => 4,
‘autoSizeMax’ => 20,
‘default’ => ‘’,
)
),
(issue imported from #M8999)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.