#84247TCA label_userfunc called for every record in current page/folder
Description
We searched all the changelogs but the wasn’t an info regarding the internal handling of label_userfunc.
We are using a label_userfunc for a normal TCA table. Creating a new record within a folder which already contains thousands of records of this type will take 30+ seconds until the TCE Form will be rendered. Debugging it, we saw that the userfunc is called for every record within the current page.
We upgrading from 6.2 to 7 LTS / 8 LTS. In Typo3 6.2 the function seems to be called only one time, so there is no delay while opening the TCE Form.
return array(
'ctrl' => array(
'title' => 'LLL:EXT:ffh_topics/Resources/Private/Language/locallang_db.xml:tx_ffhtopics_domain_model_content',
'label' => 'text_headline',
'label_userFunc' => 'RTFFH\\FfhTopics\\Userfuncs\\Tca->contentTitle',
...
)
);
The userfunc is very simple. It only fetches the record and does some string operations
public function contentTitle(&$parameters, $parentObject) {
$record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($parameters['table'], $parameters['row']['uid']);
...
}Reviews 1
Related issues 2
History 512
-
Webadmin no-lastname-given changed Related to #81036 <span data-processor="relativetime" data-value="2018-03-13T16:54:37+00:00" > 03/13/18, 16:54 </span>
-
Webadmin no-lastname-given changed Related to #82730 <span data-processor="relativetime" data-value="2018-03-13T16:55:10+00:00" > 03/13/18, 16:55 </span>
-
Webadmin no-lastname-given commented <span data-processor="relativetime" data-value="2018-03-13T16:56:22+00:00" > 03/13/18, 16:56 </span>
-
Marc Hirdes commented <span data-processor="relativetime" data-value="2022-01-25T10:17:55+00:00" > 01/25/22, 10:17 </span>
This still exists in TYPO3 10.4.23 with PHP 7.4.
The problem is the l10n_parent.
We set the type to passthrough and it worked for us
'l10n_parent' => [ 'displayCond' => 'FIELD:sys_language_uid:>:0', 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', 'config' => [ 'type' => 'passthrough', ], ],Now the user can’t select another l10n_parent, but for an IRRE element this should be ok.
-
Timo Borer commented and changed TYPO3 Version
812 PHP Version7.28.2 <span data-processor="relativetime" data-value="2023-09-21T09:45:14+00:00" > 09/21/23, 09:45 </span>This still exists in TYPO3 12.4.5 with PHP 8.2.
-
Gerrit Code Review pushed patch set 2 for main to change 81871 status
NewUnder Review <span data-processor="relativetime" data-value="2023-11-22T19:30:09+00:00" > 11/22/23, 19:30 </span> -
Gerrit Code Review pushed patch set 3 for main to change 81871 <span data-processor="relativetime" data-value="2023-11-23T12:37:27+00:00" > 11/23/23, 12:37 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 81871 <span data-processor="relativetime" data-value="2023-11-23T13:22:23+00:00" > 11/23/23, 13:22 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 81871 <span data-processor="relativetime" data-value="2024-05-28T20:47:34+00:00" > 05/28/24, 20:47 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 81871 <span data-processor="relativetime" data-value="2024-05-29T04:52:33+00:00" > 05/29/24, 04:52 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 81871 <span data-processor="relativetime" data-value="2024-07-12T17:30:14+00:00" > 07/12/24, 17:30 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 81871 <span data-processor="relativetime" data-value="2024-07-12T17:43:15+00:00" > 07/12/24, 17:43 </span>
When I change the l10n_parent to .pid=-1 it’s fast again…
'l10n_parent' => array( 'displayCond' => 'FIELD:sys_language_uid:>:0', 'exclude' => 1, 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent', 'config' => array( 'type' => 'select', 'items' => array( array('', 0), ), 'foreign_table' => 'tx_ffhtopics_domain_model_content', 'foreign_table_where' => 'AND tx_ffhtopics_domain_model_content.pid=-1 AND tx_ffhtopics_domain_model_content.sys_language_uid IN (-1,0)', ), ),