Issue Bug Closed

#85729Exception "htmlspecialchars() expects parameter 1 to be string, integer given" in TCA, if label column consists of an int

Stephan Großberndt 08/02/18, 13:46 updated 10/02/18, 10:30

Description

In TYPO3 9 and 8.7 the exception "htmlspecialchars() expects parameter 1 to be string, integer given" is thrown when accessing a record with a TCA definition where “ctrl”->“label” points to a column defined as integer in ext_tables.sql

return [
 'ctrl' => [
  'label' => 'year',
 ],
 'columns' => [
  'year' => [
   'label' => 'Year',
   'config' => [
    'type' => 'input',
    'size' => 4,
    'eval' => 'year'
   ]
  ]
 ]
];
CREATE TABLE tx_myext_year (
 uid int(10) unsigned NOT NULL auto_increment,
 pid int(10) unsigned NOT NULL default '0',

 year smallint(5) unsigned NOT NULL DEFAULT '0',

 PRIMARY KEY (uid),
 KEY year (year)
);

This is a regression in TYPO3 8.7 caused by the patch https://review.typo3.org/#/c/51151/ [!!!][FEATURE] FormEngine element level refactoring because it declares declare(strict_types = 1); in typo3/sysext/backend/Classes/Form/FieldWizard/RecordsOverview.php – in TYPO3 7.6 this works without issues.

Reviews 2