diff --git a/typo3/sysext/core/Documentation/Changelog/12.1/Feature-99011-AllowDescriptionsForRedirects.rst b/typo3/sysext/core/Documentation/Changelog/12.1/Feature-99011-AllowDescriptionsForRedirects.rst new file mode 100644 index 0000000000000000000000000000000000000000..396242409101385f81d9529f4c7994188a76846d --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/12.1/Feature-99011-AllowDescriptionsForRedirects.rst @@ -0,0 +1,29 @@ +.. include:: /Includes.rst.txt + +.. _feature-99011-1667944274: + +================================================== +Feature: #99011 - Allow descriptions for redirects +================================================== + +See :issue:`99011` + +Description +=========== + +A new field :php:`description` has been added to the :sql:`sys_redirects` table. + +In the backend edit form, the new field is located under the :guilabel:`Notes` +tab. It can be used to add context to the corresponding redirect. Since the +field is defined as the records' :php:`descriptionColumn`, the added +information is also displayed in the "Record information" info box +above the edit form, like known form e.g. content elements or pages. + +Impact +====== + +It's now possible to add additional information to a redirect +using the new description field, whose value is also displayed +in the corresponding backend edit form. + +.. index:: Database, TCA, Backend diff --git a/typo3/sysext/redirects/Classes/Service/RedirectCacheService.php b/typo3/sysext/redirects/Classes/Service/RedirectCacheService.php index 3bb8e5c7c92b58cce4ee80bf9cb2f01dccde3ec8..81c8fedd2dafa821cd1d3ffc09b28a8dad872d93 100644 --- a/typo3/sysext/redirects/Classes/Service/RedirectCacheService.php +++ b/typo3/sysext/redirects/Classes/Service/RedirectCacheService.php @@ -85,6 +85,8 @@ class RedirectCacheService } $statement = $queryBuilder->executeQuery(); while ($row = $statement->fetchAssociative()) { + // Field "description" is not needed for FE redirect handling. Don't add it to cache. + unset($row['description']); if ($row['is_regexp']) { $redirects['regexp'][$row['source_path']][$row['uid']] = $row; } elseif ($row['respect_query_parameters']) { diff --git a/typo3/sysext/redirects/Configuration/TCA/sys_redirect.php b/typo3/sysext/redirects/Configuration/TCA/sys_redirect.php index 969ccb78af8998db8ac798721de7626cd5813f08..94dc66b351155f7ecd00ce0e4642461425b7548d 100644 --- a/typo3/sysext/redirects/Configuration/TCA/sys_redirect.php +++ b/typo3/sysext/redirects/Configuration/TCA/sys_redirect.php @@ -3,6 +3,7 @@ return [ 'ctrl' => [ 'title' => 'LLL:EXT:redirects/Resources/Private/Language/locallang_db.xlf:sys_redirect', + 'descriptionColumn' => 'description', 'label' => 'source_host', 'label_alt' => 'source_path', 'label_alt_force' => true, @@ -32,7 +33,8 @@ return [ 'showitem' => ' --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general, --palette--;;source, --palette--;;targetdetails, protected, creation_type, --div--;LLL:EXT:redirects/Resources/Private/Language/locallang_db.xlf:tabs.redirectCount, disable_hitcount, hitcount, lasthiton, createdon, - --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access, --palette--;;visibility', + --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access, --palette--;;visibility, + --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes, description', ], ], 'palettes' => [ @@ -272,5 +274,14 @@ return [ 'default' => 1, ], ], + 'description' => [ + 'exclude' => true, + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.description', + 'config' => [ + 'type' => 'text', + 'rows' => 5, + 'cols' => 40, + ], + ], ], ];