Skip to content

Commit

Permalink
[REMOVAL] Remove non-integer pageUid argument support (FluidTYPO3#1662)
Browse files Browse the repository at this point in the history
Removes the support for legacy non-integer pageUid arguments
(old typolink syntax) in v:page.link. For legacy use cases, use
instead f:link.typolink

Co-authored-by: Claus Due <claus@namelesscoder.net>
  • Loading branch information
mh0rst and NamelessCoder authored Sep 2, 2021
1 parent dd0f0cb commit 22e679d
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions Classes/ViewHelpers/Page/LinkViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use FluidTYPO3\Vhs\Traits\TemplateVariableViewHelperTrait;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Context\LanguageAspect;
use TYPO3\CMS\Core\Log\LogManager;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;

Expand Down Expand Up @@ -148,27 +149,9 @@ public function render()
$pageUid = $this->arguments['pageUid'];
$additionalParameters = (array) $this->arguments['additionalParams'];
if (false === is_numeric($pageUid)) {
$linkConfig = GeneralUtility::unQuoteFilenames($pageUid, true);
if (true === isset($linkConfig[0])) {
$pageUid = $linkConfig[0];
}
if (true === isset($linkConfig[1]) && '-' !== $linkConfig[1]) {
$this->tag->addAttribute('target', $linkConfig[1]);
}
if (true === isset($linkConfig[2]) && '-' !== $linkConfig[2]) {
$this->tag->addAttribute('class', $linkConfig[2]);
}
if (true === isset($linkConfig[3]) && '-' !== $linkConfig[3]) {
$this->tag->addAttribute('title', $linkConfig[3]);
}
if (true === isset($linkConfig[4]) && '-' !== $linkConfig[4]) {
$additionalParametersString = trim($linkConfig[4], '&');
$additionalParametersArray = GeneralUtility::trimExplode('&', $additionalParametersString);
foreach ($additionalParametersArray as $parameter) {
list($key, $value) = GeneralUtility::trimExplode('=', $parameter);
$additionalParameters[$key] = $value;
}
}
GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__)
->warning("pageUid must be numeric, got " . $pageUid);
return null;
}

// Get page via pageUid argument or current id
Expand Down

0 comments on commit 22e679d

Please sign in to comment.