Issue Bug Closed

#82104IRRE + GROUP with real MM relations not working (fatal error)

Ronald Kools 08/15/17, 19:35 updated 05/07/19, 12:17

Description

See /typo3/sysext/backend/Classes/Form/Container/InlineControlContainer.php line 189:

  if ($type === 'select') {
         // A resolved select field is an array - take first value
         $value = $value['0'];
  } else {
         // A group field is still a list with pipe separated uid|tableName
          $valueParts = GeneralUtility::trimExplode('|', $value);
          $itemParts = explode('_', $valueParts[0]);
          $value = [
                'uid' => array_pop($itemParts),
                'table' => implode('_', $itemParts)
          ];
  }
  // @todo: This is weird, $value has different structure for group and select fields?
  $uniqueIds[$child['databaseRow']['uid']] = $value;

The ToDo says it all. ;-)

When not using a SELECT but a GROUP, this functions assumes the value is a string with a pipe for uid / tablename. However, when using real MM relations, $value contains an array with the uid and tablenames. This results in a fatal error:

#1476107295: PHP Warning: explode() expects parameter 2 to be string, array given in /vendor/typo3/cms/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 1297 (More information)

Reviews 2