Skip to content
Snippets Groups Projects
Commit b2d34992 authored by Benni Mack's avatar Benni Mack Committed by Stefan Neufeind
Browse files

[!!!][BUGFIX] Fluid Widget Links: Do not use cHash by default

When using the widget.link viewhelper, it is not possible to create links
without cHash.

In order to achieve this, cHash is only appended, if "useCacheHash" is
activated (addQueryString is always added, which makes sense due to the
parameters for the link).

As this is a breaking bugfix, it can only go in master.

Resolves: #83244
Resolves: #61960
Releases: master
Change-Id: I1c2dcf159a107188fd744f32de60809d15831162
Reviewed-on: https://review.typo3.org/54967


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarJigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: default avatarJigal van Hemert <jigal.van.hemert@typo3.org>
Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
parent c6a09683
Branches
Tags
No related merge requests found
.. include:: ../../Includes.txt
=======================================================================================
Breaking: #83244 - Fluid Widget Links do not add cacheHash parameter by default anymore
=======================================================================================
See :issue:`83244`
Description
===========
When using links for fluid widgets (like Paginator widgets) it is not possible to disable the cHash calculation.
A new argument "useCacheHash" for the `<f:widget.link>` and the `<f:widget.uri>` ViewHelpers has been added
to re-enable the previous behaviour.
Additionally, using cHash and addQueryString is counterproductive for deterministic caching purposes,
thus this combination should not be set by TYPO3 core by default.
Impact
======
Using the `<f:widget.link>` or `<f:widget.uri>` ViewHelper will not generate a cHash anymore.
Affected Installations
======================
Installations using extensions that are built around Fluid widgets.
Migration
=========
None. If necessary, activate the cHash calculation by using the newly introduced Fluid argument "useCacheHash".
.. index:: Fluid, NotScanned
...@@ -49,6 +49,7 @@ class LinkViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedVi ...@@ -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('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('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->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, false);
$this->registerArgument('addQueryStringMethod', 'string', 'Method to be used for query string'); $this->registerArgument('addQueryStringMethod', 'string', 'Method to be used for query string');
$this->registerArgument('action', 'string', 'Target action'); $this->registerArgument('action', 'string', 'Target action');
$this->registerArgument('arguments', 'array', 'Arguments', false, []); $this->registerArgument('arguments', 'array', 'Arguments', false, []);
...@@ -116,6 +117,7 @@ class LinkViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedVi ...@@ -116,6 +117,7 @@ class LinkViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedVi
return $uriBuilder->reset() return $uriBuilder->reset()
->setArguments([$argumentPrefix => $arguments]) ->setArguments([$argumentPrefix => $arguments])
->setSection($this->arguments['section']) ->setSection($this->arguments['section'])
->setUseCacheHash($this->arguments['useCacheHash'])
->setAddQueryString(true) ->setAddQueryString(true)
->setAddQueryStringMethod($this->arguments['addQueryStringMethod']) ->setAddQueryStringMethod($this->arguments['addQueryStringMethod'])
->setArgumentsToBeExcludedFromQueryString([$argumentPrefix, 'cHash']) ->setArgumentsToBeExcludedFromQueryString([$argumentPrefix, 'cHash'])
......
...@@ -44,6 +44,7 @@ class UriViewHelper extends AbstractViewHelper ...@@ -44,6 +44,7 @@ class UriViewHelper extends AbstractViewHelper
*/ */
public function initializeArguments() public function initializeArguments()
{ {
$this->registerArgument('useCacheHash', 'bool', 'True whether the cache hash should be appended to the URL', false, false);
$this->registerArgument('addQueryStringMethod', 'string', 'Method to be used for query string'); $this->registerArgument('addQueryStringMethod', 'string', 'Method to be used for query string');
$this->registerArgument('action', 'string', 'Target action'); $this->registerArgument('action', 'string', 'Target action');
$this->registerArgument('arguments', 'array', 'Arguments', false, []); $this->registerArgument('arguments', 'array', 'Arguments', false, []);
...@@ -113,6 +114,7 @@ class UriViewHelper extends AbstractViewHelper ...@@ -113,6 +114,7 @@ class UriViewHelper extends AbstractViewHelper
return $uriBuilder->reset() return $uriBuilder->reset()
->setArguments([$argumentPrefix => $parameters]) ->setArguments([$argumentPrefix => $parameters])
->setSection($arguments['section']) ->setSection($arguments['section'])
->setUseCacheHash($arguments['useCacheHash'])
->setAddQueryString(true) ->setAddQueryString(true)
->setAddQueryStringMethod($arguments['addQueryStringMethod']) ->setAddQueryStringMethod($arguments['addQueryStringMethod'])
->setArgumentsToBeExcludedFromQueryString([$argumentPrefix, 'cHash']) ->setArgumentsToBeExcludedFromQueryString([$argumentPrefix, 'cHash'])
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment