Bug #92963
closedFormEngine displays wrong field on symmetric side when type group is used for foreign_field/symmetric_field
100%
Description
Steps to reproduce the problem¶
- Install EXT:styleguide
- Inside
styleguide/Configuration/TCA/tx_styleguide_inline_mnsymmetric_mm.php
change the TCA for the fieldshotelid
andbranchid
to typegroup
:
'hotelid' => [
'label' => 'hotelid',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'tx_styleguide_inline_mnsymmetric',
'minitems' => 1,
'maxitems' => 1,
'size' => 1,
]
],
'branchid' => [
'label' => 'branchid',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'tx_styleguide_inline_mnsymmetric',
'minitems' => 1,
'maxitems' => 1,
'size' => 1,
]
],
- Clear the TYPO3 cache
- Create two records of table `tx_styleguide_inline_mnsymmetric` inside the TYPO3 backend
- Edit the second record, click on "Create new" in field
branches
- A new IRRE shows up, inside the IRRE in the field
branchid
select the first created record - Save your changes
Actual results¶
- In Record 1 and Record 2 inside the IRRE the field
branchid
is displayed
Expected results¶
- In Record 1 (in this case it's the symmetric side)
hotelid
should be displayed - In Record 2 (in this case it's the foreign side)
branchid
should be displayed
Additional notes¶
- Per default EXT:styleguide uses select fields inside
styleguide/Configuration/TCA/tx_styleguide_inline_mnsymmetric_mm.php
- This is working like expected, the bug occures only with type group
After some debugging i noticed, that the condition inside typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInlineIsOnSymmetricSide.php->addData()
is not working for type group.
- TYPO3 10.4.10, EXT:styleguide 10.0.4
- TYPO3 current master, EXT:styleguide 11.0.1
Files
Updated by Tim Karliczek about 4 years ago
- In
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInlineIsOnSymmetricSide.php->addData()
the relevant array is different for type select and group - That is the reason why
$result['isOnSymmetricSide']
is set totrue
when type select is used, buto tofalse
when type group is used
// with type select
$result['databaseRow']['branchId'] = [
0 => '21',
]
// with type group
$result['databaseRow']['branchId'] = [
0 => [
'table' => 'tx_styleguide_inline_mnsymmetric',
'uid' => 21,
'title' => 'Record 1',
'row' => [
'uid' => 21,
'pid' => 1,
'tstamp' => 1606804748,
'crdate' => 1606804748,
'cruser_id' => 1,
'deleted' => 0,
'hidden' => 0,
'sorting' => 256,
'sys_language_uid' => 0,
'l10n_parent' => 0,
'l10n_source' => 0,
'l10n_state' => NULL,
't3_origuid' => 0,
'l10n_diffsource' => '{"input_1":"","branches":"","sys_language_uid":"","hidden":""}',
't3ver_oid' => 0,
't3ver_wsid' => 0,
't3ver_state' => 0,
't3ver_stage' => 0,
'input_1' => 'Record 1',
'branches' => 0,
],
],
]
I think the condition should be changed to match both cases.
Updated by Gerrit Code Review about 4 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/c/Packages/TYPO3.CMS/+/66955
Updated by Tim Karliczek about 4 years ago
I added a pull request for EXT:styleguide to demonstrate the usage of a symmetric field combined with type group: https://github.com/TYPO3/styleguide/pull/171
Updated by Gerrit Code Review about 4 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/c/Packages/TYPO3.CMS/+/66955
Updated by Gerrit Code Review about 3 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/c/Packages/TYPO3.CMS/+/66955
Updated by Tim Karliczek about 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 71e54dece6ef2da10b7572b16735f6e57131366b.