Project

General

Profile

Actions

Bug #91966

closed

readOnly rendering of input is missing placeholder

Added by Robert Vock over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-08-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

Actions

Also available in: Atom PDF