Project

General

Profile

Actions

Bug #93289

closed

DefVals not working for MM-relations

Added by Maik no-lastname-given almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2021-01-14
Due date:
% Done:

100%

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

Description

Adding records as default values does not work for TCA type=group with internal_type=db and configured MM-relation.

Not working:

&defVals[tx_ext_domain_model_foo][bars]=tx_ext_domain_model_bar_1,tx_ext_domain_model_bar_3

I looked into it and found out, that the vanilla uid of the record is passed as MMuid to the RelationHandler. This leads to a database lookup of the not yet persisted record relation and an empty result. Passing 0 leads to the desired list reading and correct fetching.

I suggest changing this line to something like

$result['command'] === 'new' ? 0 : $result['databaseRow']['uid'];
Actions

Also available in: Atom PDF