Project

General

Profile

Actions

Bug #90734

closed

inlineParentUid field is set to NULL in some cases when using FormInlineAjaxController

Added by Oliver Bartsch over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2020-03-11
Due date:
% Done:

100%

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

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.

Actions #1

Updated by Oliver Bartsch over 4 years ago

  • Private changed from No to Yes
Actions #2

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

Actions #3

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;
    }
}
Actions #4

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

Actions #5

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

Actions #6

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

Actions #7

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

Actions #8

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

Actions #9

Updated by Oliver Bartsch over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF