[+BUGFIX] Avoiding cHash for nonCacheable actions prevent action from being called
authorBastian Waidelich <bastian@typo3.org>
Tue, 22 Mar 2011 15:25:22 +0000 (16:25 +0100)
committerBastian Waidelich <bastian@typo3.org>
Tue, 22 Mar 2011 15:25:22 +0000 (16:25 +0100)
With #8565 cHash is only appended for calls to cachable actions
This has the side effect, that calling non-cacheable actions
from a cached action on the same page fails to execute the
target action.
This fix reverts the changes from #8565 as we couldn't find
a better solution for now. See #13970 for details.

Change-Id: I0aebbca4a8df37ba7b7b5b63ceb0962990d814c7
Related: #13970

typo3/sysext/extbase/Classes/MVC/Web/Routing/UriBuilder.php
typo3/sysext/extbase/Tests/Unit/MVC/Web/Routing/UriBuilderTest.php

index 38a2efc..3daf718 100644 (file)
@@ -467,12 +467,6 @@ class Tx_Extbase_MVC_Web_Routing_UriBuilder {
                }
                $this->arguments = t3lib_div::array_merge_recursive_overrule($this->arguments, $prefixedControllerArguments);
 
-               if ($actionName !== NULL
-                       && $this->useCacheHash === TRUE
-                       && !Tx_Extbase_Utility_Extension::isActionCacheable($extensionName, $pluginName, $controllerArguments['controller'], $actionName)) {
-                               $this->setUseCacheHash(FALSE);
-               }
-
                return $this->build();
        }
 
index 21350d6..ee27f56 100644 (file)
@@ -178,7 +178,7 @@ class Tx_Extbase_Tests_Unit_MVC_Web_Routing_UriBuilderTest extends Tx_Extbase_Te
        /**
         * @test
         */
-       public function uriForDisablesCacheHashForNonCacheableActions() {
+       public function uriForDoesNotDisableCacheHashForNonCacheableActions() {
                $mockConfiguration = array(
                        'controllerConfiguration' => array(
                                'SomeController' => array(
@@ -192,9 +192,8 @@ class Tx_Extbase_Tests_Unit_MVC_Web_Routing_UriBuilderTest extends Tx_Extbase_Te
                $mockObjectManager->expects($this->any())->method('get')->with('Tx_Extbase_Configuration_ConfigurationManagerInterface')->will($this->returnValue($mockConfigurationManager));
                t3lib_div::setSingletonInstance('Tx_Extbase_Object_ObjectManager', $mockObjectManager);
 
-               $this->assertTrue($this->uriBuilder->getUseCacheHash());
                $this->uriBuilder->uriFor('someNonCacheableAction', array(), 'SomeController', 'SomeExtension');
-               $this->assertFalse($this->uriBuilder->getUseCacheHash());
+               $this->assertTrue($this->uriBuilder->getUseCacheHash());
 
                t3lib_div::purgeInstances();
        }