Feature #85865
closedTCA default value should accept LLL:EXT syntax
0%
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
Updated by Gerrit Code Review about 6 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
Updated by Gerrit Code Review about 6 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
Updated by Gerrit Code Review about 6 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
Updated by Gerrit Code Review about 6 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
Updated by Gerrit Code Review about 6 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
Updated by Oliver Hader about 6 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"...
Updated by Oliver Hader about 6 years ago
- Status changed from Under Review to Needs Feedback
Updated by Torben Hansen about 6 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.
Updated by Christian Kuhn about 6 years ago
- Status changed from Needs Feedback to Closed