[BUGFIX] Do no force int cast of pageUid in f:link.page 20/53520/2
authorRalf Merz <ralf@ralf-merz.de>
Sat, 15 Jul 2017 14:26:56 +0000 (16:26 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Sat, 15 Jul 2017 16:01:40 +0000 (18:01 +0200)
Since #81213, the `pageUid` argument is cast to an int. If that
parameter is omitted, pageUid becomes 0. UriBuilder is able to
determine the page uid by itself, but for this, $pageUid must be
null.

Resolves: #81881
Related: #81749
Releases: master
Change-Id: Ibc211775d657d59491beeaf8c6d4e0ff55c5e6ee
Reviewed-on: https://review.typo3.org/53520
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Achim Fritz <af@lightwerk.com>
Tested-by: Achim Fritz <af@lightwerk.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/fluid/Classes/ViewHelpers/Link/PageViewHelper.php

index 1eb8029..6997b90 100644 (file)
@@ -77,7 +77,7 @@ class PageViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedVi
      */
     public function render()
     {
-        $pageUid = (int)$this->arguments['pageUid'];
+        $pageUid = (int)$this->arguments['pageUid'] ?: null;
         $pageType = (int)$this->arguments['pageType'];
         $noCache = (bool)$this->arguments['noCache'];
         $noCacheHash = (bool)$this->arguments['useCacheHash'];