[FEATURE] Make cHash configurable in Fluid Widget Links 63/56463/7
authorGeorg Ringer <georg.ringer@gmail.com>
Tue, 27 Mar 2018 05:31:14 +0000 (07:31 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Thu, 29 Mar 2018 14:00:26 +0000 (16:00 +0200)
To be able to support TYPO3 9 and 8 with same templates, the issue
#83244 is backported to 8 as well. The default value is set to true
to make it non breaking.

Resolves: #84537
Releases: 8.7
Change-Id: I45e51ba58fd32c7577d5cd0a67f36884ed7ce57a
Reviewed-on: https://review.typo3.org/56463
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/core/Documentation/Changelog/8.7.x/Feature-84537-MakeCHashConfigurableInFluidWidgetLinks.rst [new file with mode: 0644]
typo3/sysext/fluid/Classes/ViewHelpers/Widget/LinkViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Widget/UriViewHelper.php

diff --git a/typo3/sysext/core/Documentation/Changelog/8.7.x/Feature-84537-MakeCHashConfigurableInFluidWidgetLinks.rst b/typo3/sysext/core/Documentation/Changelog/8.7.x/Feature-84537-MakeCHashConfigurableInFluidWidgetLinks.rst
new file mode 100644 (file)
index 0000000..0da5efb
--- /dev/null
@@ -0,0 +1,17 @@
+.. include:: ../../Includes.txt
+
+================================================================
+Feature: #84537 - Make cHash configurable in Fluid Widget Links
+================================================================
+
+See :issue:`84537`
+
+Description
+===========
+
+When creating links with fluid widgets it is now possible to disable the cHash calculation.
+
+A new argument `useCacheHash` for the :html:`<f:widget.link>` and the :html:`<f:widget.uri>` ViewHelpers has been added.
+By default it is set to `true` to keep the previous behavior.
+
+.. index:: Fluid, NotScanned
index 8bb3848..cbb7cad 100644 (file)
@@ -49,6 +49,7 @@ class LinkViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedVi
         $this->registerTagAttribute('rel', 'string', 'Specifies the relationship between the current document and the linked document');
         $this->registerTagAttribute('rev', 'string', 'Specifies the relationship between the linked document and the current document');
         $this->registerTagAttribute('target', 'string', 'Specifies where to open the linked document');
+        $this->registerArgument('useCacheHash', 'bool', 'True whether the cache hash should be appended to the URL', false, true);
         $this->registerArgument('addQueryStringMethod', 'string', 'Method to be used for query string');
         $this->registerArgument('action', 'string', 'Target action');
         $this->registerArgument('arguments', 'array', 'Arguments', false, []);
@@ -116,6 +117,7 @@ class LinkViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedVi
         return $uriBuilder->reset()
             ->setArguments([$argumentPrefix => $arguments])
             ->setSection($this->arguments['section'])
+            ->setUseCacheHash($this->arguments['useCacheHash'])
             ->setAddQueryString(true)
             ->setAddQueryStringMethod($this->arguments['addQueryStringMethod'])
             ->setArgumentsToBeExcludedFromQueryString([$argumentPrefix, 'cHash'])
index 9968dc2..e35d9ad 100644 (file)
@@ -39,6 +39,7 @@ class UriViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
     public function initializeArguments()
     {
         parent::initializeArguments();
+        $this->registerArgument('useCacheHash', 'bool', 'True whether the cache hash should be appended to the URL', false, true);
         $this->registerArgument('addQueryStringMethod', 'string', 'Method to be used for query string');
         $this->registerArgument('action', 'string', 'Target action');
         $this->registerArgument('arguments', 'array', 'Arguments', false, []);
@@ -104,6 +105,7 @@ class UriViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
         return $uriBuilder->reset()
             ->setArguments([$argumentPrefix => $arguments])
             ->setSection($this->arguments['section'])
+            ->setUseCacheHash($this->arguments['useCacheHash'])
             ->setAddQueryString(true)
             ->setAddQueryStringMethod($this->arguments['addQueryStringMethod'])
             ->setArgumentsToBeExcludedFromQueryString([$argumentPrefix, 'cHash'])