[BUGFIX] Show record title for inline element
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Form / FormDataProvider / TcaRecordTitle.php
index ca9d44a..f31d0ce 100644 (file)
@@ -159,7 +159,8 @@ class TcaRecordTitle implements FormDataProviderInterface
                 $recordTitle = $this->getRecordTitleForRadioType($rawValue, $fieldConfig);
                 break;
             case 'inline':
-                // intentional fall-through
+                $recordTitle = $this->getRecordTitleForInlineType($rawValue, $result['processedTca']['columns'][$fieldName]['children']);
+                break;
             case 'select':
                 $recordTitle = $this->getRecordTitleForSelectType($rawValue, $fieldConfig);
                 break;
@@ -205,6 +206,23 @@ class TcaRecordTitle implements FormDataProviderInterface
     }
 
     /**
+     * @param int $value
+     * @param array $children
+     *
+     * @return string
+     */
+    protected function getRecordTitleForInlineType($value, array $children)
+    {
+        foreach ($children as $child) {
+            if ((int)$value === $child['vanillaUid']) {
+                return $child['recordTitle'];
+            }
+        }
+
+        return '';
+    }
+
+    /**
      * Return the record title for database records
      *
      * @param mixed $value Current database value of this field