[TASK] Drop THIS_CID 68/42068/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 28 Jul 2015 18:32:48 +0000 (20:32 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Tue, 28 Jul 2015 18:44:59 +0000 (20:44 +0200)
PageTsConfig can be configured to manipulate some queries in
the backend using marker based logic. One marker is THIS_CID
which refers to a record with field 'cid'. This field exists
nowhere and never did. The code dates back straight to Kaspers
initial subversion commit.
The only reference to this field is a german blog post stating
no further information can be found about this undocumented
feature.
Drop it.

Resolves: #68598
Releases: master
Change-Id: If2bea39cf2311051b893e71028702871c13ca771
Reviewed-on: http://review.typo3.org/42068
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php

index 910086e..5db2703 100755 (executable)
@@ -3499,7 +3499,6 @@ class BackendUtility {
         * Special markers are:
         * ###REC_FIELD_[field name]###
         * ###THIS_UID### - is current element uid (zero if new).
-        * ###THIS_CID###
         * ###CURRENT_PID### - is the current page id (pid of the record).
         * ###STORAGE_PID###
         * ###SITEROOT###
@@ -3533,7 +3532,6 @@ class BackendUtility {
                        array (
                                '###CURRENT_PID###',
                                '###THIS_UID###',
-                               '###THIS_CID###',
                                '###STORAGE_PID###',
                                '###SITEROOT###',
                                '###PAGE_TSCONFIG_ID###',
@@ -3543,7 +3541,6 @@ class BackendUtility {
                        array(
                                (int)$tsConfig['_CURRENT_PID'],
                                (int)$tsConfig['_THIS_UID'],
-                               (int)$tsConfig['_THIS_CID'],
                                (int)$tsConfig['_STORAGE_PID'],
                                (int)$tsConfig['_SITEROOT'],
                                (int)$tsConfig[$field]['PAGE_TSCONFIG_ID'],
@@ -3585,7 +3582,6 @@ class BackendUtility {
                }
                $res['_CURRENT_PID'] = $cPid;
                $res['_THIS_UID'] = $row['uid'];
-               $res['_THIS_CID'] = $row['cid'];
                // So the row will be passed to foreign_table_where_query()
                $res['_THIS_ROW'] = $row;
                $rootLine = self::BEgetRootLine($TScID, '', TRUE);
index 3f69ce0..cc0c632 100644 (file)
@@ -1014,20 +1014,6 @@ class BackendUtilityTest extends UnitTestCase {
                                ),
                                ' AND dummytable.uid=42'
                        ),
-                       'replaceMarkersInWhereClause replaces current record cid with integer' => array(
-                               ' AND dummytable.uid=###THIS_CID###',
-                               array(
-                                       '_THIS_CID' => 42
-                               ),
-                               ' AND dummytable.uid=42'
-                       ),
-                       'replaceMarkersInWhereClause replaces current record cid with string' => array(
-                               ' AND dummytable.uid=###THIS_CID###',
-                               array(
-                                       '_THIS_CID' => '42string'
-                               ),
-                               ' AND dummytable.uid=42'
-                       ),
                        'replaceMarkersInWhereClause replaces storage pid with integer' => array(
                                ' AND dummytable.uid=###STORAGE_PID###',
                                array(
@@ -1088,7 +1074,6 @@ class BackendUtilityTest extends UnitTestCase {
                                ' AND dummytable.uid=###REC_FIELD_uid###' .
                                ' AND dummytable.pid=###CURRENT_PID###' .
                                ' AND dummytable.l18n_parent=###THIS_UID###' .
-                               ' AND dummytable.cid=###THIS_CID###' .
                                ' AND dummytable.storage_pid=###STORAGE_PID###' .
                                ' AND dummytable.siteroot=###SITEROOT###' .
                                ' AND dummytable.config_uid=###PAGE_TSCONFIG_ID###' .
@@ -1101,7 +1086,6 @@ class BackendUtilityTest extends UnitTestCase {
                                        ),
                                        '_CURRENT_PID' => '1',
                                        '_THIS_UID' => 2,
-                                       '_THIS_CID' => 3,
                                        '_STORAGE_PID' => 4,
                                        '_SITEROOT' => 5,
                                        'dummyfield' => array(
@@ -1111,7 +1095,7 @@ class BackendUtilityTest extends UnitTestCase {
                                        )
                                ),
                                ' AND dummytable.title=\'Hello World\' AND dummytable.uid=\'42\' AND dummytable.pid=1' .
-                               ' AND dummytable.l18n_parent=2 AND dummytable.cid=3 AND dummytable.storage_pid=4' .
+                               ' AND dummytable.l18n_parent=2 AND dummytable.storage_pid=4' .
                                ' AND dummytable.siteroot=5 AND dummytable.config_uid=6 AND dummytable.idlist IN (1,2,3)' .
                                ' AND dummytable.string=\'string\'',
                        ),