Bug #59397
closedBug #59414: Move all TCA from ext_tables.php to TCA/Overrides for core extensions
Extbase FrontendUser does not work with the TCA caching feature (6.2.1)
100%
Description
I use the following code to add a field to the fe_users
table:
$newColumns = array(
'ratings' => array(
'label' => $lll . 'somelabel',
'config' => array(
'readOnly' => '1',
'type' => 'select',
'foreign_table' => 'mytable',
'foreign_field' => 'somefield',
'maxitems' => '1000000',
'minitems' => '0',
'autoSizeMax' => '20',
),
),
);
ExtensionManagementUtility::addTCAcolumns('fe_users', $newColumns);
// Add types to the TCA
$recordType = 'MyRecordType';
$GLOBALS['TCA']['fe_users']['types'][$recordType] = $GLOBALS['TCA']['fe_users']['types']['0'];
$GLOBALS['TCA']['fe_users']['columns']['tx_extbase_type']['config']['items'][] = array(
$lll . 'anotherlabel',
$recordType
);
ExtensionManagementUtility::addToAllTCAtypes('fe_users', 'ratings', $recordType, 'after:tx_extbase_type');
This does work if used in ext_tables.php
, but not if used in Configuration/TCA/Overrides
. In the latter case, it seems that the ext_tables.php
from Extbase is executed later and overwrites my changes (especially the types
part).
Regards Jost
Updated by Anja Leichsenring over 10 years ago
- Status changed from New to Needs Feedback
Please set in your extension a dependency to extbase. This changes the loading order and should ensure your configuration is the last to be served. Anyway, you are not safe in order to prevent other extensions to override your types again.
Can you test this and give feedback, wheter setting dependency solves the problem?
Updated by Jost Baron over 10 years ago
Hi Anja,
setting the dependency did not help, I tried that already.
Updated by Frans Saris over 10 years ago
Anja,that was my first thought to. But it is the types part that breaks imo. Because the ext_tables.php is renderend every time it overrides the cached values.
Gr. Frans
Updated by Gerrit Code Review over 10 years ago
- Status changed from Needs Feedback 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/30620
Updated by Anja Leichsenring over 10 years ago
Can you please test my patch? It works for me now with the cleanup.
For reference, my <extensionkey>/Configuration/TCA/Overrides/fe_users.php looks like this:
<?php $recordType = 'MyRecordType'; $tca = array( 'columns' => array( 'ratings' => array( 'label' => $lll . 'somelabel', 'config' => array( 'readOnly' => '1', 'type' => 'select', 'foreign_table' => 'mytable', 'foreign_field' => 'somefield', 'maxitems' => '1000000', 'minitems' => '0', 'autoSizeMax' => '20', ), ), ), 'types' => array( $recordType => $GLOBALS['TCA']['fe_users']['types']['0'] ), ); $GLOBALS['TCA']['fe_users'] = array_replace_recursive($GLOBALS['TCA']['fe_users'], $tca); $GLOBALS['TCA']['fe_users']['columns']['tx_extbase_type']['config']['items'][] = array( 'anotherlabel', $recordType ); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('fe_users', 'ratings', $recordType, 'after:tx_extbase_type');
Updated by Gerrit Code Review over 10 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/30620
Updated by Gerrit Code Review over 10 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/30620
Updated by Gerrit Code Review over 10 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/30620
Updated by Gerrit Code Review over 10 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/30620
Updated by Gerrit Code Review over 10 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/30620
Updated by Gerrit Code Review over 10 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/30620
Updated by Anja Leichsenring over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 382457d241514ea200eaadc4c258ed75cdc57727.