(no commit message)
[paste/270.git] / typo-core-fal-patch.diff
1 commit 82027c3d7df7ca7d9558ae2d21e16eeda1f82333\r
2 Author: Andreas Wolf <dev@a-w.io>\r
3 Date:   Tue Nov 10 10:37:17 2015 +0100\r
4 \r
5     [BUGFIX] Flexform DS not properly resolved in IRRE AJAX\r
6     \r
7     If multiple data structures are defined for a flex field, they are\r
8     listed in the 'ds' entry of the field’s TCA config. In this case, the\r
9     proper data structure needs to be resolved first before processing the\r
10     inline request, the necessary steps for which are introduced by this\r
11     patch.\r
12     \r
13     Resolves: #71436\r
14     Releases: master\r
15     Change-Id: Ie846ddd11efdf76b9249feb3a9d8a67b38de3983\r
16 \r
17 diff --git typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php\r
18 index 9336141..4b2fe8b 100644\r
19 --- typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php\r
20 +++ typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php\r
21 @@ -21,11 +21,13 @@ use TYPO3\CMS\Backend\Form\FormDataGroup\InlineParentRecord;\r
22  use TYPO3\CMS\Backend\Form\FormDataGroup\TcaDatabaseRecord;\r
23  use TYPO3\CMS\Backend\Form\InlineStackProcessor;\r
24  use TYPO3\CMS\Backend\Form\NodeFactory;\r
25 +use TYPO3\CMS\Backend\Utility\BackendUtility;\r
26  use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;\r
27  use TYPO3\CMS\Core\DataHandling\DataHandler;\r
28  use TYPO3\CMS\Core\Utility\GeneralUtility;\r
29  use TYPO3\CMS\Core\Utility\MathUtility;\r
30  \r
31 +\r
32  /**\r
33   * Handle FormEngine inline ajax calls\r
34   */\r
35 @@ -62,10 +64,8 @@ class FormInlineAjaxController\r
36          if (MathUtility::canBeInterpretedAsInteger($parent['uid'])) {\r
37              $command = 'edit';\r
38              $vanillaUid = (int)$parent['uid'];\r
39 -            $databaseRow = [\r
40 -                // TcaInlineExpandCollapseState needs the record uid\r
41 -                'uid' => (int)$parent['uid'],\r
42 -            ];\r
43 +            // we need the full record to e.g. fetch the proper data structure\r
44 +            $databaseRow = BackendUtility::getRecord($parent['table'], $parent['uid']);\r
45          } else {\r
46              $command = 'new';\r
47              $databaseRow = [];\r
48 @@ -85,9 +85,12 @@ class FormInlineAjaxController\r
49          ];\r
50          /** @var TcaDatabaseRecord $formDataGroup */\r
51          $formDataGroup = GeneralUtility::makeInstance(InlineParentRecord::class);\r
52 +\r
53 +\r
54          /** @var FormDataCompiler $formDataCompiler */\r
55          $formDataCompiler = GeneralUtility::makeInstance(FormDataCompiler::class, $formDataGroup);\r
56          $parentData = $formDataCompiler->compile($formDataCompilerInputForParent);\r
57 +\r
58          $parentConfig = $parentData['processedTca']['columns'][$parentFieldName]['config'];\r
59  \r
60          // Child, a record from this table should be rendered\r