[BUGFIX] Avoid reference index records for images in RTE fields 92/28292/7
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Mon, 17 Mar 2014 16:37:10 +0000 (12:37 -0400)
committerMarc Bastian Heinrichs <typo3@mbh-software.de>
Mon, 17 Mar 2014 19:01:20 +0000 (20:01 +0100)
Since images in RTE fields are handled as relations to sys_file
records adding references to the reference index for the concrete
image paths are obsolete and causes trouble with impexp.

Resolves: #56811
Releases: 6.2
Change-Id: I26a2531f417ff8b628b69156a3a2236c99960d5e
Reviewed-on: https://review.typo3.org/28292
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
Reviewed-by: Fabien Udriot
Tested-by: Fabien Udriot
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs
typo3/sysext/install/Classes/Updates/RteMagicImagesUpdateWizard.php
typo3/sysext/rtehtmlarea/hooks/softref/ext_tables.php

index 16eb38c..7281652 100644 (file)
@@ -206,6 +206,7 @@ class RteMagicImagesUpdateWizard extends AbstractUpdate {
                                                'hash=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($refRecord['hash'], 'sys_refindex'),
                                                array(
                                                        'ref_table'  => 'sys_file',
+                                                       'softref_key' => 'rtehtmlarea_images',
                                                        'ref_uid'    => $file->getUid(),
                                                        'ref_string' => $fileadminDirectory . $targetFileName
                                                )
index 628e6d3..dd50f58 100644 (file)
@@ -10,7 +10,10 @@ foreach ($tempTables as $table) {
        foreach ($GLOBALS['TCA'][$table]['columns'] as $column => $config) {
                if ($config['config']['softref']) {
                        if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($config['config']['softref'], 'images')) {
-                               $GLOBALS['TCA'][$table]['columns'][$column]['config']['softref'] = 'rtehtmlarea_images,' . $GLOBALS['TCA'][$table]['columns'][$column]['config']['softref'];
+                               // Remove obsolete soft reference key 'images'
+                               // The references from RTE content to the original images are handled with the key 'rtehtmlarea_images'.
+                               $softReferences = 'rtehtmlarea_images,' . \TYPO3\CMS\Core\Utility\GeneralUtility::rmFromList('images', $config['config']['softref']);
+                               $GLOBALS['TCA'][$table]['columns'][$column]['config']['softref'] = $softReferences;
                        }
                } else {
                        if ($config['config']['type'] == 'text') {