[BUGFIX] Fade out record translations if main records gets deleted 28/42328/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Thu, 6 Aug 2015 17:34:37 +0000 (19:34 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Thu, 6 Aug 2015 17:53:59 +0000 (19:53 +0200)
If a record with translations gets deleted, translations must vanish from
the record list.

Resolves: #68808
Releases: master
Change-Id: Ic16bb256bdc6ee27e0c98a7e02f07abc1a85cd2b
Reviewed-on: http://review.typo3.org/42328
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
typo3/sysext/backend/Classes/RecordList/AbstractRecordList.php
typo3/sysext/backend/Resources/Public/JavaScript/AjaxDataHandler.js
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index 32ad437..796dcfd 100644 (file)
@@ -206,9 +206,10 @@ abstract class AbstractRecordList {
                $colType = ($colType === 'th') ? 'th' : 'td';
                $noWrap = $this->no_noWrap ? '' : ' nowrap="nowrap"';
                // Start up:
+               $parent = isset($data['parent']) ? (int)$data['parent'] : 0;
                $out = '
                <!-- Element, begin: -->
-               <tr ' . $rowParams . ' data-uid="' . (int)$data['uid'] . '">';
+               <tr ' . $rowParams . ' data-uid="' . (int)$data['uid'] . '" data-l10nparent="' . $parent . '">';
                // Show icon and lines
                if ($this->showIcon) {
                        $out .= '
index 8815247..8f7a01b 100644 (file)
@@ -160,7 +160,7 @@ define('TYPO3/CMS/Backend/AjaxDataHandler', ['jquery', 'TYPO3/CMS/Backend/Notifi
                                var table = $table.data('table');
                                var $rowElements = $anchorElement.closest('tr[data-uid]');
                                var uid = $rowElements.data('uid');
-                               var $translatedRowElements = $table.find('[data-l10parent=' + uid + ']').closest('tr[data-uid]');
+                               var $translatedRowElements = $table.find('[data-l10nparent=' + uid + ']').closest('tr[data-uid]');
                                $rowElements = $rowElements.add($translatedRowElements);
 
                                $rowElements.fadeTo('slow', 0.4, function() {
index ca96353..2987844 100644 (file)
@@ -821,6 +821,13 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                $this->addElement_tdCssClass['_LOCALIZATION_b'] = 'col-localizationb';
                // Create element in table cells:
                $theData['uid'] = $row['uid'];
+               if (
+                       isset($GLOBALS['TCA'][$table]['ctrl']['languageField'])
+                       && isset($GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'])
+                       && !isset($GLOBALS['TCA'][$table]['ctrl']['transOrigPointerTable'])
+               ) {
+                       $theData['parent'] = $row[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']];
+               }
                $rowOutput .= $this->addelement(1, $theIcon, $theData, $row_bgColor);
                // Finally, return table row element:
                return $rowOutput;