Issue Bug Closed

#87728LinkBuilder on pages with site configuration should not ignore setNoCache

Rozbeh Chiryai Sharahi 02/17/19, 18:28 updated 05/07/19, 12:10

Description

Hello,

i just realized that

\TYPO3\CMS\Frontend\Typolink\PageLinkBuilder::build

will ignore

$conf['no_cache']=1

if we are in the context of a page with site configuration.

Suggestion:

1) Create Functional Test for \TYPO3\CMS\Frontend\Typolink\PageLinkBuilder or for \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder that will check for `no_cache` parameter to be set.

2) Add something like:

if($conf['no_cache']) {
  $queryParameters['no_cache'] = 1
}

to

\TYPO3\CMS\Frontend\Typolink\PageLinkBuilder::generateUrlForPageWithSiteConfiguration

Reproduce:

On any page with site configuration in any controller action do following:

$this->uriBuilder->reset()->setTargetPageUid(123)->setNoCache(true)->build();

Kind regards
Rozbeh Chiryai Sharahi

Reviews 2