[BUGFIX] No RTE Transformation for subtype_value_field-fields of plugins 43/23743/4
authorTim Lochmueller <tim@fruit-lab.de>
Wed, 11 Sep 2013 12:54:29 +0000 (14:54 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sun, 7 Dec 2014 20:46:57 +0000 (21:46 +0100)
The RTE transformation depends on the result of BackendUtility
getTCAtypes. If the RTE field is in the subtypes_addlist of a plugin
the transformation is not performed. The patch adds the related
subtype fields to the return value.

Resolves: #51901
Releases: 6.2, master
Change-Id: I8bba3d03b5187b06fec5a9b5a0e151466d814d60
Reviewed-on: http://review.typo3.org/23743
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
typo3/sysext/backend/Classes/Utility/BackendUtility.php

index a59bbec..8f104b7 100644 (file)
@@ -736,6 +736,17 @@ class BackendUtility {
                        $typesConf = $GLOBALS['TCA'][$table]['types'][$fieldValue];
                        // Get fields list and traverse it
                        $fieldList = explode(',', $typesConf['showitem']);
+
+                       // Add subtype fields e.g. for a valid RTE transformation
+                       // The RTE runs the DB -> RTE transformation only, if the RTE field is part of the getTCAtypes array
+                       if (isset($typesConf['subtype_value_field'])) {
+                               $subType = $rec[$typesConf['subtype_value_field']];
+                               if (isset($typesConf['subtypes_addlist'][$subType])) {
+                                       $subFields = GeneralUtility::trimExplode(',', $typesConf['subtypes_addlist'][$subType], TRUE);
+                                       $fieldList = array_merge($fieldList, $subFields);
+                               }
+                       }
+
                        $altFieldList = array();
                        // Traverse fields in types config and parse the configuration into a nice array:
                        foreach ($fieldList as $k => $v) {