Feature #82990
closedHidden TCA fields are rendered if used as label
100%
Description
Hello there,
there is a flaw in the way TYPO3 handle the rendering of the backend Edit Forms in TYPO3 7 (and possibly in TYPO3 8 but I did not test that there). As it turns out, if a field is used as a label, the underlying form field is always rendered.
Now this is not a problem in 99.9% of the time but it is in one place that concerns every TYPO3: editing sys_file_metadata on a system with thousands of files. What happens is, that since the label of the sys_file_metadata record is the field file, the FormDataProvider TcaColumnsProcessRecordTitle
will add file
to the columnsToProcess
for the current record and the TcaSelectItems
will happily work it's way through and generate the html for the select box. Bare in mind, that this is absolute and utter dead weight since nowhere in the TCA showItem
definition of any type the file
field is referenced. This would not be to big of a problem since in most systems there are no more than 10k files but in systems with 100'000+ the memory get's used up and it can lead to memory exhausted
errors in PHP (even with as much as 512M memory_limit).
Would it be possible to handle this special case in some way? Maybe by adding an additional DataProvider that removes all columsn that are not needed by showItem?
Best Regards
Tizian
Updated by Tizian Schmidlin almost 7 years ago
- Assignee set to Tizian Schmidlin
I'm currently working on a fix by removing columnsToProcess
from TcaColumnsProcessRecordTitle
, I'll test it and provide a patch asap.
Updated by Tizian Schmidlin almost 7 years ago
As it appears, it's not possible to simply say "screw title fields" or anything, since everything is very intertwined :-(
What I'd like to propose is an additional configuration field for TCA to tell the TcaSelectItems data provider to not translate the labels, which should make sense, at least, for sys_file_metadata.
Updated by Tizian Schmidlin almost 7 years ago
Patch:
--- a/typo3_src-7.6.23/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php
+++ b/typo3_src-7.6.23/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaSelectItems.php
@@ -90,8 +90,10 @@ class TcaSelectItems extends AbstractItemProvider implements FormDataProviderInt
$removedItems
);
- // Translate labels
- $fieldConfig['config']['items'] = $this->translateLabels($result, $fieldConfig['config']['items'], $table, $fieldName);
+ if(!isset($fieldConfig['config']['doNotTranslate']) || !$fieldConfig['config']['doNotTranslate']) {
+ // Translate labels
+ $fieldConfig['config']['items'] = $this->translateLabels($result, $fieldConfig['config']['items'], $table, $fieldName);
+ }
// Keys may contain table names, so a numeric array is created
$fieldConfig['config']['items'] = array_values($fieldConfig['config']['items']);
Updated by Gerrit Code Review almost 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/c/Packages/TYPO3.CMS/+/61970
Updated by Tizian Schmidlin almost 5 years ago
- Tracker changed from Bug to Feature
Updated by Gerrit Code Review almost 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/c/Packages/TYPO3.CMS/+/61970
Updated by Gerrit Code Review almost 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/c/Packages/TYPO3.CMS/+/61970
Updated by Gerrit Code Review almost 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/c/Packages/TYPO3.CMS/+/61970
Updated by Gerrit Code Review almost 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/c/Packages/TYPO3.CMS/+/61970
Updated by Gerrit Code Review almost 5 years ago
Patch set 6 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/+/61970
Updated by Gerrit Code Review almost 5 years ago
Patch set 7 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/+/61970
Updated by Gerrit Code Review almost 5 years ago
Patch set 8 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/+/61970
Updated by Gerrit Code Review over 4 years ago
Patch set 9 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/+/61970
Updated by Gerrit Code Review over 4 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63742
Updated by Tizian Schmidlin over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 7e1203a12cd03b315e0a49180b1788e78bb4c7a9.
Updated by Xavier Perseguers over 4 years ago
- Precedes Bug #91130: TCA for field "status" in EXT:filemetatada is broken since TYPO3 v9 added