Project

General

Profile

Actions

Bug #82330

closed

cant create inline records if ctrl > enablecolumns > endtime is not specified in childrens TCA

Added by Tobias Liebig over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2017-09-07
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Yes
Sprint Focus:

Description

In 7.6.22 i can't create new inline child records, if the child TCA does not specify ctrl >enablecolumns > endtime.

When trying to create a new inline record, the BE shows an "Error 500 Internal Server Error" notification and sys_log logs an "Uncaught TYPO3 Exception":

Core: Exception handler (WEB): Uncaught TYPO3 Exception: Unsupported operand types | Error thrown in file /Users/tobias/ownCloud/Projekte/etobi/devdev7/vendor/typo3/cms/typo3/sysext/backend/Classes/Utility/BackendUtility.php in line 1555. Requested URL: http://devdev7.dev/typo3/index.php?ajaxID=%%2Fajax%%2Frecord%%2Finline%%2Fcreate&ajaxToken=d3804bcc88a0d5127fbc06f7bf2bb7e7e48b5d9a

Setup/Steps to reproduce:

  • TYPO3 7.6.22
  • two tables (parent record and child record)
  • the parent record have an inline relation to the child records
  • both recors are NOT localizable (thus NO TCA ctrl > languageField specified)
  • the child record DOES NOT specify enablecolumns > endtime
  • create a new parent record
  • create a new inline child record
  • the Ajax call will throw an "Uncaught TYPO3 Exception: Unsupported operand types"

Analysis:

In \TYPO3\CMS\Backend\Controller\FormInlineAjaxController L138-L140:
As $GLOBALS['TCA'][$parent['table']]['ctrl']['languageField']; and $GLOBALS['TCA'][$child['table']]['ctrl']['languageField']; are empty, an array like [0 => ''] will be added to $childData['databaseRow'] with an empty index key.

Later $childData['databaseRow'] will be passed to \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordIconAltText.

At the end of getRecordIconAltText L2025 the records endtime is read. As enablecolumns > endtime is not specified, $ctrl['endtime'] will be empty and $row[$ctrl['endtime']] will return the [0 => ''] array added in FormInlineAjaxController L140.

$row[$ctrl['endtime']] (the [0 => ''] array) will be passed to \TYPO3\CMS\Backend\Utility\BackendUtility::daysUntil.

$delta_t = $tstamp - $GLOBALS['EXEC_TIME']; throws the "Unsupported operand types" as you can't subtract an int from an array.

This bug does not happen for starttime, as $ctrl['starttime'] as this is checked in \TYPO3\CMS\Backend\Utility\BackendUtility L2020

Solution:
  • check if ['ctrl']['languageField'] (both for parent and child) are not empty in \TYPO3\CMS\Backend\Controller\FormInlineAjaxController L136
  • check if $ctrl['endtime'] is not empty in \TYPO3\CMS\Backend\Utility\BackendUtility L2025

Related issues 5 (0 open5 closed)

Related to TYPO3 Core - Bug #48883: Wrong sys_language_uid in sys_file_referenceClosed2013-06-05

Actions
Related to TYPO3 Core - Bug #76048: IRRE: Child records - New record doesn't get language of parent (non localized records but using new button)ClosedJo Hasenau2016-05-04

Actions
Related to TYPO3 Core - Bug #73609: Creating IRRE child element without language of parent elementClosed2016-02-22

Actions
Has duplicate TYPO3 Core - Bug #82391: Inline records in TYPO3 v. 7.6.22 crash when NOT having sys_language_uid on childrenClosed2017-09-08

Actions
Has duplicate TYPO3 Core - Bug #82564: Error when adding inline record that has no endtime column configuredRejected2017-09-26

Actions
Actions

Also available in: Atom PDF