Bug #91966
closedreadOnly rendering of input is missing placeholder
100%
Description
If you set a field in TCA to readOnly, it is still rendered in the backend (which is great to see the value). If the field is a relation to sys_file_reference it's also possible to toggle the Inline view and see the sys_file_reference data (like alternative and description). Those fields do not show their placeholder (which would come from sys_file_metadata instead of sys_file_reference, if the field is empty).
It would be nice, if the readOnly preview would show the value of the placeholder.
It's only needed to add the placeholder to the disabled field:
InputTextElement.php:L97
'placeholder' => $config['placeholder'] ?? '',
The check for the placeholder is currently done later (after the function already returned because of readOnly):
InputTextElement.php:L297
Relevant TCA:
$TCA['tx_example_project']['columns']['image'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(...); // default image TCA
$TCA['tx_example_project']['columns']['image']['config']['readOnly'] = true;
I am not sure, if this is considered a bug or a feature. I am also not sure, if the category is correct. It's possible that FormEngine is better.
Updated by Gerrit Code Review over 4 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/c/Packages/TYPO3.CMS/+/65286
Updated by Georg Ringer over 4 years ago
- Tracker changed from Feature to Bug
- Category deleted (
Backend User Interface) - TYPO3 Version set to 10
Updated by Christian Kuhn over 4 years ago
Styleguide:
Added inline_2 to inline_fal example to show this scenario in styleguide master & 10.
Note some metadata has to be added to one of the styleguide example images first. The generator should do that automatically though, this will be handled in styleguide with https://github.com/TYPO3/styleguide/issues/158
Updated by Gerrit Code Review over 4 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/c/Packages/TYPO3.CMS/+/65286
Updated by Gerrit Code Review over 4 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65307
Updated by Georg Ringer over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 22d7201441198ef4dfdc5f5c39fd8b8336c48f1e.