Project

General

Profile

Actions

Bug #95716

closed

TCA title with plain string crashes NewRecordController

Added by Christian Eßl about 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
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)), ':');

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #94049: NewRecordController does not fetch group label from Extension Configuration when NOT using LLL labelsClosed2021-05-04

Actions
Actions

Also available in: Atom PDF