[TASK] Remove deprecated modifyPageId hook 26/28326/2
authorWouter Wolters <typo3@wouterwolters.nl>
Wed, 12 Mar 2014 19:58:45 +0000 (20:58 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Thu, 13 Mar 2014 05:28:51 +0000 (06:28 +0100)
Resolves: #56848
Releases: 6.2
Change-Id: Icb1e0566dc44dbf7278db50224dc256b94be853b
Reviewed-on: https://review.typo3.org/28326
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php

index 6b26ed3..2fea2c6 100644 (file)
@@ -1295,27 +1295,6 @@ class TypoScriptFrontendController {
                $this->idParts = explode(',', $this->id);
                $this->id = $this->idParts[0];
 
-                       // Hook for further id manipulation
-               if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['modifyPageId'])) {
-                       $_params = array('id' => $this->id);
-                       $newId = FALSE;
-                       foreach ($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['modifyPageId'] as $_funcRef) {
-                               $deprecationMessage = 'Hook $TYPO3_CONF_VARS[SC_OPTIONS][tslib/class.tslib_fe.php][modifyPageId] is ' .
-                                       'deprecated since 6.0 and will be removed two versions later';
-                               if (!is_object($_funcRef) || !is_a($_funcRef, 'Closure')) {
-                                       $deprecationMessage .= '- used by ' . $_funcRef;
-                               }
-                               \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog($deprecationMessage);
-                               $newIdFromFunc = GeneralUtility::callUserFunction($_funcRef, $_params, $this);
-                               if ($newIdFromFunc !== FALSE) {
-                                       $newId = $newIdFromFunc;
-                               }
-                       }
-                       if ($newId !== FALSE) {
-                               $this->id = $newId;
-                       }
-               }
-
                // If $this->id is a string, it's an alias
                $this->checkAndSetAlias();
                // The id and type is set to the integer-value - just to be sure...
index dfaa137..d09998e 100644 (file)
@@ -142,39 +142,4 @@ class TypoScriptFrontendControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCas
                $this->assertEquals($clearText, $this->fixture->_callRef('roundTripCryptString', $refValue));
        }
 
-       /**
-        * @test
-        */
-       public function isModifyPageIdTestCalled() {
-               $GLOBALS['TT'] = $this->getMock('TYPO3\\CMS\Core\\TimeTracker\\TimeTracker');
-               $this->fixture = $this->getMock(
-                       '\\TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController',
-                       array(
-                               'initUserGroups',
-                               'setSysPageWhereClause',
-                               'checkAndSetAlias',
-                               'findDomainRecord',
-                               'getPageAndRootlineWithDomain'
-                       ),
-                       array(),
-                       '',
-                       FALSE
-               );
-               $this->fixture->page = array();
-
-               $pageRepository = $this->getMock('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
-               \TYPO3\CMS\Core\Utility\GeneralUtility::addInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository', $pageRepository);
-
-               $initialId = rand(1, 500);
-               $expectedId = $initialId + 42;
-               $this->fixture->id = $initialId;
-
-               $this->fixture->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['modifyPageId'][] = function($params, $frontendController) {
-                       return $params['id'] + 42;
-               };
-
-               $this->fixture->fetch_the_id();
-               $this->assertSame($expectedId, $this->fixture->id);
-       }
-
 }