#111060IRRE useCombination: type=group selector resolves wrong child uid in AJAX details
Description
Problem
- fixed the child uid resolution for a
type=groupforeign_selectorinTcaInline::compileChildChild(). The same code inFormInlineAjaxController::compileChildChild()was not changed.
A group field resolves to an array of arrays (['table' => ..., 'uid' => ...]), so
$childChildUid = $child['databaseRow'][$parentConfig['foreign_selector']][0];
// ...
'vanillaUid' => (int)$childChildUid,
casts an array to int and always gives uid 1.
Affected
Opening an existing intermediate record via AJAX (details action, also synchronize/localize) when the selector is a group field. The combination child shown is the record with uid 1, not the selected one.
Possible solution
Use the same check as in TcaInline:
$childChildValue = $child['databaseRow'][$parentConfig['foreign_selector']][0];
$childChildUid = is_array($childChildValue) ? $childChildValue['uid'] : $childChildValue;
The two methods are copies of each other (see the @todo in the controller), so a shared helper would avoid this in the future.
Related: #109232, #102904, #81176
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[BUGFIX] IRRE useCombination: type=group selector resolves wrong child uid in AJAX details Resolves: #111060 Releases: main