Bug #82391

Inline records in TYPO3 v. 7.6.22 crash when NOT having sys_language_uid on children

Added by Claus Harup about 2 years ago. Updated about 2 years ago.

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

0%

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

Description

I have a few plugins containing records without DB field sys_language_uid...... - after upgrading to 7.6.22 I get an error 500 when trying to add the record as inline to.... let's say pages.

Sure I can add the language configuration fields, but maybe the core should check for the existence of the field before trying to set the field?!

sysext/backend/Classes/Controller/FormInlineAjaxController.php

if ($parent['localizationMode'] === 'select' && MathUtility::canBeInterpretedAsInteger($parent['uid'])) {
  $parentRecord = $inlineRelatedRecordResolver->getRecord($parent['table'], $parent['uid']);
  $parentLanguageField = $GLOBALS['TCA'][$parent['table']]['ctrl']['languageField'];
  $childLanguageField = $GLOBALS['TCA'][$child['table']]['ctrl']['languageField'];
  if ($parentRecord[$parentLanguageField] > 0) {
    $record[$childLanguageField] = $parentRecord[$parentLanguageField]; <---------!!!!!!!!
  }
}

Greatings, Claus

TYPO3 rocks!!!!


Related issues

Duplicates TYPO3 Core - Bug #82330: cant create inline records if ctrl > enablecolumns > endtime is not specified in childrens TCA Closed 2017-09-07

History

#1 Updated by Malte Muth about 2 years ago

The snippet posted seems to be from version 7.6.21; commit ID 9d3aa8618b changed this to

if ($parent['localizationMode'] !== 'keep' && MathUtility::canBeInterpretedAsInteger($parent['uid'])) {
    $parentRecord = BackendUtility::getRecord($parent['table'], $parent['uid']);
    $parentLanguageField = $GLOBALS['TCA'][$parent['table']]['ctrl']['languageField'];
    $childLanguageField = $GLOBALS['TCA'][$child['table']]['ctrl']['languageField'];
    $childData['databaseRow'][$childLanguageField][0] = $parentRecord[$parentLanguageField];
}

Either way, the behaviour is still "500" when trying to add childs to records that have

localizationMode === false

I think this is a regression, since 7.6.21 worked, as the check

if ($parentRecord[$parentLanguageField] > 0) {

caught this. I propose to add

$parent['localizationMode']

to the conditions - can anybody with some knowledge chime in?

#2 Updated by Mathias Brodala about 2 years ago

  • Duplicates Bug #82330: cant create inline records if ctrl > enablecolumns > endtime is not specified in childrens TCA added

#3 Updated by Mathias Brodala about 2 years ago

  • Status changed from New to Closed

Please see #82330

Also available in: Atom PDF