Bug #90734
closedinlineParentUid field is set to NULL in some cases when using FormInlineAjaxController
100%
Description
Opening an inline record calls the /record/inline/details route which targets FormInlineAjaxController::detailAction().
There, the composed parentData might not hold the databaseRow which is used in FormInlineAjaxController::compileChild() to set the inlineParentUid.
This information is however needed for custom FromDataProvides to e.g. retrieve information of the parent record and use them as conditions to adjust the inline elements TCA or similar.
Updated by Oliver Bartsch over 4 years ago
After calling this->compileChild() there is the assignment $childData['inlineParentUid'] = (int)$parent['uid'] which is too late as the the compileChild() calls the FormDataCompiler::compile() inside without the inlineParentUid
Updated by Oliver Bartsch over 4 years ago
- Private changed from Yes to No
Steps to reproduce (using styleguide extension)¶
- Add a custom FormDataProvider (See example code below)
- Create a new record (type: tx_styleguide_inline_1n)
- Add an inline element (tx_styleguide_inline_1n_child)
- Save record
- Open the inline element by clicking on it (The inline element must be collapsed when the FormEngine loads)
- Debug the $result['inlineParentUid'] in your custom FormDataProvider -> It is NULL
Example code:
// Register fromDataProvider in ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][\TYPO3\CMS\Styleguide\Backend\Form\FormDataProvider\ProcessInline::class] =
[
'depends' => [
\TYPO3\CMS\Backend\Form\FormDataProvider\TcaInline::class
]
];
// Create FormDataProvider in EXT:styleguide/Classes/Backend/Form/FormDataProvider/ProcessInline.php
<?php
declare(strict_types=1);
namespace TYPO3\CMS\Styleguide\Backend\Form\FormDataProvider;
use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
class ProcessInline implements FormDataProviderInterface
{
/**
* @param array $result
*
* @return array
*/
public function addData(array $result): array
{
// Debug $result['inlineParentUid'] here
return $result;
}
}
Updated by Gerrit Code Review over 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/+/63686
Updated by Gerrit Code Review over 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/+/63686
Updated by Gerrit Code Review over 4 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/+/63686
Updated by Gerrit Code Review over 4 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/c/Packages/TYPO3.CMS/+/63686
Updated by Gerrit Code Review over 4 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63976
Updated by Oliver Bartsch over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 61935dc305280cbba760177ccaf1f4ae06de9675.