Project

General

Profile

Actions

Bug #82104

closed

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

Added by Ronald Kools over 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2017-08-15
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
group, irre, relations
Complexity:
Is Regression:
Sprint Focus:

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)


Files

sample_0.0.1_201809271609.zip (7.55 KB) sample_0.0.1_201809271609.zip Cyril Janody, 2018-09-28 00:19

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #84735: InlineControlContainer wrongly assumes group field values are still a stringClosed2018-04-15

Actions
Actions #1

Updated by Ronald Kools over 7 years ago

This error occurs when using an IRRE with 'foreign_unique'.

Actions #2

Updated by Ronald Kools over 7 years ago

  • Category deleted (Form Framework)
Actions #3

Updated by Ronald Kools almost 7 years ago

  • Category set to Extbase
Actions #4

Updated by Tymoteusz Motylewski about 6 years ago

  • Category changed from Extbase to FormEngine aka TCEforms

changed category to the correct one

Actions #5

Updated by Cyril Janody about 6 years ago

Hi all,

Just add a sample extension.

Simply create one or more obj1, obj2 and link them.

Will push a fix soon.

Actions #6

Updated by Gerrit Code Review about 6 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58421

Actions #7

Updated by Gerrit Code Review about 6 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58422

Actions #8

Updated by Tymoteusz Motylewski about 6 years ago

Cyril,
Can you please do a pull request with your example to the Styleguide extenstion ?https://github.com/TYPO3/styleguide

This will make sure that its easier for everybody to test, and in the future we can test this case with never TYPO3 versions.
Please let me know if you have any questions.

Actions #9

Updated by Gerrit Code Review about 6 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58421

Actions #10

Updated by Cyril Janody about 6 years ago

Hi Timoteusz,
Pull request https://github.com/TYPO3/styleguide/pull/121
Thank you

Actions #11

Updated by Christian Kuhn about 6 years ago

  • Related to Bug #84735: InlineControlContainer wrongly assumes group field values are still a string added
Actions #12

Updated by Gerrit Code Review about 6 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58421

Actions #13

Updated by Gerrit Code Review about 6 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58421

Actions #14

Updated by Cyril Janody about 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #15

Updated by Gerrit Code Review about 6 years ago

  • Status changed from Resolved to Under Review

Patch set 3 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58422

Actions #16

Updated by Cyril Janody about 6 years ago

  • Status changed from Under Review to Resolved
Actions #17

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF