Project

General

Profile

Actions

Feature #85865

closed

TCA default value should accept LLL:EXT syntax

Added by Torben Hansen over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2018-08-15
Due date:
% Done:

0%

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

Description

It should be possible to control the default value of a TCA field using the LLL:EXT syntax like shown below

'config' => [
    'type' => 'input',
    'size' => 4,
    'readOnly' => true,
    'default' => 'EXT:LLL:myext/Resources/Private/Language/locallang_db.xlf:field_default',
]

Use case for this scenario is for example a readonly input field, where the value is assigned using a datahandler hook, but you want to show the editor, that the value will be set automatically. In order to keep the backend fully translated, it should be possible to set a localized value as default.

Edge case of course, but should be easy to implement in

TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowDefaultValues

Actions #1

Updated by Gerrit Code Review over 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58195

Actions #2

Updated by Gerrit Code Review over 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58195

Actions #3

Updated by Gerrit Code Review over 5 years ago

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

Actions #4

Updated by Gerrit Code Review over 5 years ago

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

Actions #5

Updated by Gerrit Code Review over 5 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58195

Actions #6

Updated by Oliver Hader over 5 years ago

I see some disadvantages of introducing this change:

  • label translation happens for the language of the current backend user, not for the actual language of the content/record (already pointed out by Susi in #typo3-cms-coredev channel)
  • `default` is used in DataHandler was well to provide default values for new records - the mentioned dependency on the current BackendUser might get problematic when importing data via CLI interface (and potentially lead to invalid results)

In general I see this feature only related to the "view", but not related to "persistence". Therefore e.g. HTML placeholders could be used as "suggestion"...

Actions #7

Updated by Oliver Hader over 5 years ago

  • Status changed from Under Review to Needs Feedback
Actions #8

Updated by Torben Hansen over 5 years ago

Thanks for pointing out the disadvantages. I think placeholders are a good option to achieve my needs.

If no one disagrees, the issue can be closed.

Actions #9

Updated by Christian Kuhn over 5 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF