Bug #82096 ยป FormInlineAjaxController.php.patch

Bart Lammers, 2017-09-13 14:11

View differences:

typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php
1 1
<?php
2

  
2 3
namespace TYPO3\CMS\Backend\Controller;
3 4

  
4 5
/*
......
96 97
        $parentData = $formDataCompiler->compile($formDataCompilerInputForParent);
97 98
        $parentConfig = $parentData['processedTca']['columns'][$parentFieldName]['config'];
98 99

  
100
        if (isset($ajaxArguments['context'])) {
101
            $context = json_decode($ajaxArguments['context'], true);
102
            if (GeneralUtility::hmac(serialize($context['config'])) === $context['hmac']) {
103
                $parentConfig = $context['config'];
104
            }
105
        }
106

  
99 107
        // Child, a record from this table should be rendered
100 108
        $child = $inlineStackProcessor->getUnstableStructure();
101 109
        if (MathUtility::canBeInterpretedAsInteger($child['uid'])) {
......
261 269
        $parentData = $formDataCompiler->compile($formDataCompilerInputForParent);
262 270
        $parentConfig = $parentData['processedTca']['columns'][$parentFieldName]['config'];
263 271

  
272
        if (isset($ajaxArguments['context'])) {
273
            $context = json_decode($ajaxArguments['context'], true);
274
            if (GeneralUtility::hmac(serialize($context['config'])) === $context['hmac']) {
275
                $parentConfig = $context['config'];
276
            }
277
        }
278

  
264 279
        if ($parentConfig['type'] === 'flex') {
265 280
            $parentConfig = $this->getParentConfigFromFlexForm($parentConfig, $domObjectId);
266 281
            $parentData['processedTca']['columns'][$parentFieldName]['config'] = $parentConfig;
......
358 373
            $formDataCompiler = GeneralUtility::makeInstance(FormDataCompiler::class, $formDataGroup);
359 374
            $parentData = $formDataCompiler->compile($formDataCompilerInputForParent);
360 375
            $parentConfig = $parentData['processedTca']['columns'][$parentFieldName]['config'];
376

  
377
            if (isset($ajaxArguments['context'])) {
378
                $context = json_decode($ajaxArguments['context'], true);
379
                if (GeneralUtility::hmac(serialize($context['config'])) === $context['hmac']) {
380
                    $parentConfig = $context['config'];
381
                }
382
            }
383

  
361 384
            $parentLanguageField = $parentData['processedTca']['ctrl']['languageField'];
362 385
            $parentLanguage = $parentData['databaseRow'][$parentLanguageField];
363 386
            $oldItemList = $parentData['databaseRow'][$parentFieldName];
......
550 573
            'inlineParentTableName' => $parentData['tableName'],
551 574
            'inlineParentFieldName' => $parentFieldName,
552 575

  
553
             // values of the top most parent element set on first level and not overridden on following levels
576
            // values of the top most parent element set on first level and not overridden on following levels
554 577
            'inlineTopMostParentUid' => $parentData['inlineTopMostParentUid'] ?: $inlineTopMostParent['uid'],
555 578
            'inlineTopMostParentTableName' => $parentData['inlineTopMostParentTableName'] ?: $inlineTopMostParent['table'],
556 579
            'inlineTopMostParentFieldName' => $parentData['inlineTopMostParentFieldName'] ?: $inlineTopMostParent['field'],
    (1-1/1)