Commit 5cd1cd21 authored by Fabian Galinski's avatar Fabian Galinski

[BUGFIX] not implemented type unknown appears if a redirect isn't a page uid

parent b4185eaf
<?php
namespace SGalinski\SgRoutes\Hook;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Backend\Form\Element\InputLinkElement;
/**
* Class UnknownLinkHandlerType
*/
class UnknownLinkHandlerType {
const TABLE_NAME = 'tx_sgroutes_domain_model_route';
/**
* @param array $linkData
* @param array $linkParts
* @param array $inputLinkElementData
* @param InputLinkElement $inputLinkElement
* @return array
*/
public function getFormData(
$linkData, $linkParts, $inputLinkElementData, InputLinkElement $inputLinkElement
): array {
if (isset($inputLinkElementData['tableName']) && $inputLinkElementData['tableName'] === self::TABLE_NAME) {
return [];
}
return [
'text' => 'not implemented type ' . $linkData['type'],
'icon' => ''
];
}
}
<?php
// hook for url redirect
// hook registration
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['determineId-PostProc']['sg_routes']
= 'SGalinski\SgRoutes\Service\RoutingService->hook';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['linkHandler']['unknown'] =
\SGalinski\SgRoutes\Hook\UnknownLinkHandlerType::class;
if (TYPO3_MODE === 'BE') {
$extPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('sg_routes');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment