Bug #17478
closedTCA: label and label_alt need to check for recursion in order to avoid an infinite loop
0%
Description
When a reference to the same record type is used as label_alt (while I suppose that the same problem exists for label, I suppose), a reference to t he current record will cause TYPO3 to hang in an infinite loop when trying to render the list view.
Example:
SQL:
#- Table structure for table 'tx_vehicles_vehicle_attributes'
#
CREATE TABLE tx_vehicles_vehicle_attributes (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL,
crdate int(11) DEFAULT '0' NOT NULL,
cruser_id int(11) DEFAULT '0' NOT NULL,
sorting int(10) DEFAULT '0' NOT NULL,
deleted tinyint(4) DEFAULT '0' NOT NULL,
hidden tinyint(4) DEFAULT '0' NOT NULL,
name tinytext NOT NULL,
token tinytext NOT NULL,
attribute_type_id int(11) DEFAULT '0' NOT NULL,
vehicle_type int(11) DEFAULT '0' NOT NULL,
parent_id int(11) DEFAULT '0' NOT NULL,
children int(11) DEFAULT '0' NOT NULL,PRIMARY KEY (uid),
KEY parent (pid)
);
ext_tables.php:
$TCA['tx_vehicles_vehicle_attributes'] = Array (
'ctrl' => Array (
'title' => 'LLL:EXT:vehicles/locallang_db.xml:tx_vehicles_vehicle_attributes',
'label' => 'name',
'label_alt' => 'parent_id',
'label_alt_force' => 1,
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'sortby' => 'sorting',
'delete' => 'deleted',
'enablecolumns' => Array (
'disabled' => 'hidden',
),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'icon_tx_vehicles_vehicle_attributes.gif',
),
'feInterface' => Array (
'fe_admin_fieldList' => 'hidden, name, attribute_type_id, vehicle_type',
)
);
TCA:
$TCA['tx_vehicles_vehicle_attributes'] = Array (
'ctrl' => $TCA['tx_vehicles_vehicle_attributes']['ctrl'],
'interface' => Array (
'showRecordFieldList' => 'hidden,name,token,attribute_type_id,vehicle_type,parent_id,children'
),
'feInterface' => $TCA['tx_vehicles_vehicle_attributes']['feInterface'],
'columns' => Array (
'hidden' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => Array (
'type' => 'check',
'default' => '0'
)
),
'token' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:vehicles/locallang_db.xml:tx_vehicles_vehicle_attributes.token',
'config' => Array (
'type' => 'input',
'size' => '30',
)
),
'name' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:vehicles/locallang_db.xml:tx_vehicles_vehicle_attributes.name',
'config' => Array (
'type' => 'input',
'size' => '30',
'eval' => 'required',
)
),
'attribute_type_id' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:vehicles/locallang_db.xml:tx_vehicles_vehicle_attributes.attribute_type_id',
'config' => Array (
'type' => 'select',
'foreign_table' => 'tx_vehicles_attribute_types',
'foreign_table_where' => 'AND tx_vehicles_attribute_types.pid=###STORAGE_PID### ORDER BY tx_vehicles_attribute_types.sorting',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
)
),
'vehicle_type' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:vehicles/locallang_db.xml:tx_vehicles_vehicle_attributes.vehicle_type',
'config' => Array (
'type' => 'select',
'foreign_table' => 'tx_vehicles_vehicle_types',
'foreign_table_where' => 'AND tx_vehicles_vehicle_types.pid=###STORAGE_PID### ORDER BY tx_vehicles_vehicle_types.uid',
'size' => 3,
'minitems' => 0,
'maxitems' => 9,
'MM' => 'tx_vehicles_vehicle_attributes_vehicle_type_mm',
)
),
'parent_id' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:vehicles/locallang_db.xml:tx_vehicles_vehicle_attributes.parent_id',
'config' => Array (
'type' => 'select',
'foreign_table' => 'tx_vehicles_vehicle_attributes',
'foreign_table_where' =>
'AND tx_vehicles_vehicle_attributes.pid=###CURRENT_PID### '
.'AND tx_vehicles_vehicle_attributes.uid!=###THIS_UID### '
.'ORDER BY tx_vehicles_vehicle_attributes.name',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
'items' => array(
'' => 0
)
)
),
'children' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:vehicles/locallang_db.xml:tx_vehicles_vehicle_attributes.children',
'config' => Array (
'type' => 'inline',
'foreign_table' => 'tx_vehicles_vehicle_attributes',
'appearance' => array(
'collapseAll' => 0,
'newRecordLinkAddTitle' => 0,
'newRecordLinkPosition' => 'bottom',
'useSortable' => 1
),
'foreign_field' => 'parent_id',
'foreign_sortby' => 'sorting'
)
)
),
'types' => Array (
'0' => Array('showitem' => 'hidden;;1;;1-1-1, name, token, attribute_type_id, vehicle_type, parent_id, children')
),
'palettes' => Array (
'1' => Array('showitem' => '')
)
);
(issue imported from #M5984)