Created
June 25, 2018 18:08
-
-
Save lorenzulrich/c00a7198cb1b67f6a287d28705567eb5 to your computer and use it in GitHub Desktop.
TYPO3 8.7: Core patch to migrate links from EXT:linkhandler to built-in link handling functionality
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 316ce38b479321c0227a74b545786ac256f5d13b | |
Author: Jonas Renggli <jonas.renggli@visol.ch> | |
Date: Mon Feb 12 16:48:09 2018 +0100 | |
[FEATURE] Add migration for recordLinks from legacy EXT:linkhandler | |
[FEATURE] Add migration for language links from legacy EXT:cabag_langlink | |
diff --git a/typo3/sysext/core/Classes/LinkHandling/LegacyLinkNotationConverter.php b/typo3/sysext/core/Classes/LinkHandling/LegacyLinkNotationConverter.php | |
index a89b67813e..0539cc6d4f 100644 | |
--- a/typo3/sysext/core/Classes/LinkHandling/LegacyLinkNotationConverter.php | |
+++ b/typo3/sysext/core/Classes/LinkHandling/LegacyLinkNotationConverter.php | |
@@ -62,6 +62,16 @@ class LegacyLinkNotationConverter | |
// Resolve FAL-api "file:UID-of-sys_file-record" and "file:combined-identifier" | |
if (stripos($linkParameter, 'file:') === 0) { | |
$result = $this->getFileOrFolderObjectFromMixedIdentifier(substr($linkParameter, 5)); | |
+ } elseif (stripos($linkParameter, 'record:') === 0) { | |
+ $linkParameterParts = GeneralUtility::trimExplode(':', $linkParameter); | |
+ $result['url'] = sprintf('t3://record?identifier=%s&uid=%d', $linkParameterParts[1], $linkParameterParts[3]); | |
+ } elseif (stripos($linkParameter, '?id=L:') === 0) { | |
+ if (preg_match('#\\?id=L:([0-9]+)/([^&]+)#', $linkParameter, $matches)) { | |
+ $lang = $matches[1]; | |
+ $uid = $matches[2]; | |
+ | |
+ $result['url'] = sprintf('t3://page?uid=%d&L=%d', $uid, $lang); | |
+ } | |
} elseif (GeneralUtility::validEmail(parse_url($linkParameter, PHP_URL_PATH))) { | |
$result['type'] = LinkService::TYPE_EMAIL; | |
$result['email'] = $linkParameter; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment