Actions
Bug #95716
closedTCA title with plain string crashes NewRecordController
Start date:
2021-10-20
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Yes
Sprint Focus:
Description
Create a TCA for a table, that is not using a path to a language file (LLL:EXT:...) in ctrl/title, but instead a plain string:
$GLOBALS['TCA']['tx_example'] = [
'ctrl' => [
'title' => 'Bob',
...
],
...
If you now click the "Create new record" button in the list module, an exception will be thrown:
(1/1) TypeError
strtok() expects parameter 1 to be string, bool given
This is because in the NewRecordController, the following line assumes a string starting with "LLL:EXT:" and the substr function is returning false:
// Try to get localisation of extension title
$langFile = strtok(substr($title, 9 + strlen($_EXTKEY)), ':');
Actions