Skip to content

Commit

Permalink
[BUGFIX] Provide inlineParentUid in FormInlineAjaxController
Browse files Browse the repository at this point in the history
By expanding an inline record the AJAX request calls the `detailAction`
in `FormInlineAjaxController`. The parent data array created in this
function does not contain the parent record's uid nor its database row.

In order to ensure that the uid is not NULL, in any FormDataProvider,
the uid is now added to the parent data array. This value is then used
as fallback in case there is no database row given in the `compileChild`
function which calls the FormDataProviders.

Resolves: #90734
Releases: master, 9.5
Change-Id: I66a4a20980d6c62a3e87496b6261b25f5e22aea6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63976
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
  • Loading branch information
o-ba authored and bmack committed Mar 31, 2020
1 parent 41d827c commit 64b406b
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -207,6 +207,7 @@ public function detailsAction(ServerRequestInterface $request): ResponseInterfac
],
],
],
'uid' => $parent['uid'],
'tableName' => $parent['table'],
'inlineFirstPid' => $inlineFirstPid,
// Hand over given original return url to compile stack. Needed if inline children compile links to
Expand Down Expand Up @@ -501,7 +502,7 @@ protected function compileChild(array $parentData, $parentFieldName, $childUid,

// values of the current parent element
// it is always a string either an id or new...
'inlineParentUid' => $parentData['databaseRow']['uid'],
'inlineParentUid' => $parentData['databaseRow']['uid'] ?? $parentData['uid'],
'inlineParentTableName' => $parentData['tableName'],
'inlineParentFieldName' => $parentFieldName,

Expand Down

0 comments on commit 64b406b

Please sign in to comment.