Skip to content
Snippets Groups Projects
Commit d15d1aef authored by Christoph Schwob's avatar Christoph Schwob Committed by Georg Ringer
Browse files

[FEATURE] Add a description field to redirects

Add a description field also for redirects, which
could be used to add notes for further handling of
the correpsonding redirect. This follows the same
logic like for other record types.

Resolves: #99011
Releases: main
Change-Id: I216eca8e72b9bf825ad9542997ec603f01ddc879
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76456


Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
parent d3d088f5
Branches
Tags
No related merge requests found
.. 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
......@@ -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']) {
......
......@@ -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,
],
],
],
];
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