Skip to content

Commit

Permalink
[BUGFIX] Check if title is provided before accessing it
Browse files Browse the repository at this point in the history
If no title is provided for a table in the TCA (ctrl|title),
the wizard for creating new records must not fail with an
exception.

Resolves: #88642
Releases: master, 9.5
Change-Id: Icdda8fdc4e8eb37a09cb8b918fc39b732c28d5b1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61165
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Julian Geils <j_geils@web.de>
Tested-by: Benjamin Franzke <bfr@qbus.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Julian Geils <j_geils@web.de>
Reviewed-by: Benjamin Franzke <bfr@qbus.de>
  • Loading branch information
georgringer authored and bnf committed Jul 10, 2019
1 parent 7d5d378 commit 7aa0a81
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -579,12 +579,13 @@ protected function renderNewRecordControls(ServerRequestInterface $request): voi
$_EXTKEY = '';
if ($nameParts[0] === 'tx' || $nameParts[0] === 'tt') {
// Try to extract extension name
if (strpos($v['ctrl']['title'], 'LLL:EXT:') === 0) {
$_EXTKEY = substr($v['ctrl']['title'], 8);
$title = (string)($v['ctrl']['title'] ?? '');
if (strpos($title, 'LLL:EXT:') === 0) {
$_EXTKEY = substr($title, 8);
$_EXTKEY = substr($_EXTKEY, 0, strpos($_EXTKEY, '/'));
if ($_EXTKEY !== '') {
// First try to get localisation of extension title
$temp = explode(':', substr($v['ctrl']['title'], 9 + strlen($_EXTKEY)));
$temp = explode(':', substr($title, 9 + strlen($_EXTKEY)));
$langFile = $temp[0];
$thisTitle = $lang->sL('LLL:EXT:' . $_EXTKEY . '/' . $langFile . ':extension.title');
// If no localisation available, read title from ext_emconf.php
Expand Down

0 comments on commit 7aa0a81

Please sign in to comment.