[!!!][CLEANUP] Remove ancient template selection hack feature 18/34318/3
authorMarkus Klein <klein.t3@reelworx.at>
Tue, 18 Nov 2014 19:50:42 +0000 (20:50 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Wed, 19 Nov 2014 18:42:54 +0000 (19:42 +0100)
Resolves: #63056
Releases: master
Change-Id: I26454e664f2d394cd13d0dee283ef6cba025b5b2
Reviewed-on: http://review.typo3.org/34318
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/core/Classes/TypoScript/TemplateService.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-63056-TemplateSelectionHack.rst [new file with mode: 0644]

index d40337b..16e0c51 100644 (file)
@@ -643,41 +643,21 @@ class TemplateService {
                // Include "Based On" sys_templates:
                // 'basedOn' is a list of templates to include
                if (trim($row['basedOn'])) {
-                       // Manually you can put this value in the field and then the based_on ID will be taken from the $_GET var defined by '=....'.
-                       // Example: If $row['basedOn'] is 'EXTERNAL_BASED_ON_TEMPLATE_ID=based_on_uid', then the global var, based_on_uid - given by the URL like '&based_on_uid=999' - is included instead!
-                       // This feature allows us a hack to test/demonstrate various included templates on the same set of content bearing pages. Used by the "freesite" extension.
-                       $basedOn_hackFeature = explode('=', $row['basedOn']);
-                       if ($basedOn_hackFeature[0] == 'EXTERNAL_BASED_ON_TEMPLATE_ID' && $basedOn_hackFeature[1]) {
-                               $id = (int)GeneralUtility::_GET($basedOn_hackFeature[1]);
-                               // If $id is not allready included ...
-                               if ($id && !GeneralUtility::inList($idList, ('sys_' . $id))) {
-                                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_template', 'uid=' . $id . ' ' . $this->whereClause);
-                                       // there was a template, then we fetch that
-                                       if ($subrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                                               $this->versionOL($subrow);
-                                               if (is_array($subrow)) {
-                                                       $this->processTemplate($subrow, $idList . ',sys_' . $id, $pid, 'sys_' . $id, $templateID);
-                                               }
-                                       }
-                                       $GLOBALS['TYPO3_DB']->sql_free_result($res);
+                       // Normal Operation, which is to include the "based-on" sys_templates,
+                       // if they are not already included, and maintaining the sorting of the templates
+                       $basedOnIds = GeneralUtility::intExplode(',', $row['basedOn']);
+                       // skip template if it's already included
+                       foreach ($basedOnIds as $key => $basedOnId) {
+                               if (GeneralUtility::inList($idList, 'sys_' . $basedOnId)) {
+                                       unset($basedOnIds[$key]);
                                }
-                       } else {
-                               // Normal Operation, which is to include the "based-on" sys_templates,
-                               // if they are not already included, and maintaining the sorting of the templates
-                               $basedOnIds = GeneralUtility::intExplode(',', $row['basedOn']);
-                               // skip template if it's already included
-                               foreach ($basedOnIds as $key => $basedOnId) {
-                                       if (GeneralUtility::inList($idList, 'sys_' . $basedOnId)) {
-                                               unset($basedOnIds[$key]);
-                                       }
-                               }
-                               $subTemplates = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'sys_template', 'uid IN (' . implode(',', $basedOnIds) . ') ' . $this->whereClause, '', '', '', 'uid');
-                               // Traversing list again to ensure the sorting of the templates
-                               foreach ($basedOnIds as $id) {
-                                       if (is_array($subTemplates[$id])) {
-                                               $this->versionOL($subTemplates[$id]);
-                                               $this->processTemplate($subTemplates[$id], $idList . ',sys_' . $id, $pid, 'sys_' . $id, $templateID);
-                                       }
+                       }
+                       $subTemplates = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'sys_template', 'uid IN (' . implode(',', $basedOnIds) . ') ' . $this->whereClause, '', '', '', 'uid');
+                       // Traversing list again to ensure the sorting of the templates
+                       foreach ($basedOnIds as $id) {
+                               if (is_array($subTemplates[$id])) {
+                                       $this->versionOL($subTemplates[$id]);
+                                       $this->processTemplate($subTemplates[$id], $idList . ',sys_' . $id, $pid, 'sys_' . $id, $templateID);
                                }
                        }
                }
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-63056-TemplateSelectionHack.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-63056-TemplateSelectionHack.rst
new file mode 100644 (file)
index 0000000..d101f37
--- /dev/null
@@ -0,0 +1,25 @@
+=================================================
+Breaking: #63056 - Remove Template Selection Hack
+=================================================
+
+Description
+===========
+
+There has been an ancient hack for the former "freesite" extension, which enabled selection
+of the template via GET variable.
+This technique is totally outdated and removed.
+
+Impact
+======
+
+Any extension using this hack will not be able to select the template in this way anymore.
+
+Affected installations
+======================
+
+Installations with third party extensions using the hack.
+
+Migration
+=========
+
+No migration path intended.