[BUGFIX] Solve a then-else mismatch for foreign_label 65/44265/2
authorStefan Froemken <froemken@gmail.com>
Sun, 25 Oct 2015 07:16:07 +0000 (08:16 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 31 Oct 2015 13:30:03 +0000 (14:30 +0100)
I have changed then-part with else-part, because in
case of fields of type "inline" it is not possible
to have values like tx_table_123.

Resolves: #71002
Releases: master
Change-Id: Ib274b0f8b477001cabd4b681da505b6dde71f156
Reviewed-on: https://review.typo3.org/44265
Reviewed-by: Ruud Silvrants <ruudsilvrants@gmail.com>
Reviewed-by: Sebastian Fischer <typo3@evoweb.de>
Tested-by: Sebastian Fischer <typo3@evoweb.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php

index de9d66f..28cbec6 100644 (file)
@@ -333,19 +333,19 @@ class InlineRecordContainer extends AbstractContainer
             $recTitle = $data['recordTitle'];
         } elseif ($hasForeignLabel || $hasSymmetricLabel) {
             $titleCol = $hasForeignLabel ? $config['foreign_label'] : $config['symmetric_label'];
-            // Render title for everything else than group/db:
+            // Render title for group/db:
             if (isset($this->data['processedTca']['columns'][$titleCol]['config']['type'])
                 && $this->data['processedTca']['columns'][$titleCol]['config']['type'] === 'group'
                 && isset($this->data['processedTca']['columns'][$titleCol]['config']['internal_type'])
                 && $this->data['processedTca']['columns'][$titleCol]['config']['internal_type'] === 'db'
             ) {
-                $recTitle = BackendUtility::getProcessedValueExtra($foreign_table, $titleCol, $rec[$titleCol], 0, 0, false);
-            } else {
                 // $recTitle could be something like: "tx_table_123|...",
                 $valueParts = GeneralUtility::trimExplode('|', $rec[$titleCol]);
                 $itemParts = GeneralUtility::revExplode('_', $valueParts[0], 2);
                 $recTemp = BackendUtility::getRecordWSOL($itemParts[0], $itemParts[1]);
                 $recTitle = BackendUtility::getRecordTitle($itemParts[0], $recTemp, false);
+            } else {
+                $recTitle = BackendUtility::getProcessedValueExtra($foreign_table, $titleCol, $rec[$titleCol], 0, 0, false);
             }
             $recTitle = BackendUtility::getRecordTitlePrep($recTitle);
             if (trim($recTitle) === '') {