Skip to content

Commit

Permalink
[TASK] fix for linkParts type if not set
Browse files Browse the repository at this point in the history
  • Loading branch information
tlayh committed Jul 28, 2023
1 parent 426058d commit 0b3b981
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Classes/Typo3/Hook/LinkWizzard.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ public function initialize(AbstractLinkBrowserController $linkBrowser, $identifi
*/
public function canHandleLink(array $linkParts): bool
{
if ($linkParts['type'] === null || strcmp($linkParts['type'], 'happy_feet') !== 0) {
return false;
if (isset($linkParts['type'])) {
if ($linkParts['type'] === null || strcmp($linkParts['type'], 'happy_feet') !== 0) {
return false;
}
}

if (!$linkParts['url']) {
return false;
}
Expand All @@ -89,7 +92,7 @@ public function canHandleLink(array $linkParts): bool
} else {
$linkParts['tableName'] = $this->getLanguageService()->sL($GLOBALS['TCA'][$table]['ctrl']['title']);
$linkParts['pid'] = (int) $record['pid'];
$linkParts['title'] = $linkParts['title'] ?: BackendUtility::getRecordTitle($table, $record);
$linkParts['title'] = isset($linkParts['title']) ?: BackendUtility::getRecordTitle($table, $record);
}
$linkParts['url']['type'] = $linkParts['type'];
$this->linkParts = $linkParts;
Expand Down

0 comments on commit 0b3b981

Please sign in to comment.