Project

General

Profile

Actions

Feature #100195

closed

Make Shortcut Target [shortcut] a required field for pages.doktype = 4 (Shortcut)

Added by Sybille Peters over 1 year ago. Updated 5 months ago.

Status:
Rejected
Priority:
Should have
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2023-03-17
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

is a bit difficult to solve:

!!! If shortcut_mode != 0, the shortcut is not necessary. So we can't just make it a required field in this case.
!!! If we add a displayCond (see below) and make it reuqired, we can't switch from shortcut_mode = 0 to shortcut_mode != 0 and empty 'shortcut' (because due to the displayCond the form would be saved and this is prevented by the required)

1. shortcut should only be displayed if shortcut_mode=0
2. if displayed, shortcut should be required
3. ?? if a translation, empty shortcut seems to be ok as well (though other fields behave differently)

Thus, the following code cannot be used:

Configuration/TCA/Overrides/pages.php:

    // condition: show shortcut if shortcut_mode = 0
    $GLOBALS['TCA']['pages']['columns']['shortcut']['displayCond'] = 'FIELD:shortcut_mode:=:0';

    // override type "shortcut": make it a a required field
    $GLOBALS['TCA']['pages']['types'][(string)\TYPO3\CMS\Core\Domain\Repository\PageRepository::DOKTYPE_SHORTCUT]['columnsOverrides'] =
    [
        'shortcut' => [
            'config' => [
                'eval' => 'required',
            ],
        ],
    ];


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #100194: Make tt_content.records a required field if tt_content.CType = 'shortcut'RejectedSybille Peters2023-03-17

Actions
Actions #1

Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78145

Actions #2

Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/78145

Actions #3

Updated by Sybille Peters over 1 year ago

  • Status changed from Under Review to New
Actions #4

Updated by Sybille Peters over 1 year ago

  • Description updated (diff)
Actions #5

Updated by Sybille Peters over 1 year ago

  • Related to Feature #100194: Make tt_content.records a required field if tt_content.CType = 'shortcut' added
Actions #6

Updated by Sybille Peters 5 months ago

  • Status changed from New to Rejected

Closing now. This is not so easy to solve because the behaviour depends on shortcut_mode. Also, see comments in patch: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78145

Actions

Also available in: Atom PDF