Project

General

Profile

Actions

Bug #59397

closed

Bug #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)

Added by Jost Baron almost 10 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2014-06-06
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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

Actions #1

Updated by Anja Leichsenring almost 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?

Actions #2

Updated by Jost Baron almost 10 years ago

Hi Anja,

setting the dependency did not help, I tried that already.

Actions #3

Updated by Frans Saris almost 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

Actions #4

Updated by Gerrit Code Review almost 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

Actions #5

Updated by Anja Leichsenring almost 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');
Actions #6

Updated by Gerrit Code Review almost 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

Actions #7

Updated by Gerrit Code Review almost 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

Actions #8

Updated by Gerrit Code Review almost 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

Actions #9

Updated by Gerrit Code Review almost 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

Actions #10

Updated by Gerrit Code Review almost 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

Actions #11

Updated by Gerrit Code Review almost 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

Actions #12

Updated by Anja Leichsenring almost 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #13

Updated by Anja Leichsenring almost 10 years ago

  • Parent task set to #59414
Actions #14

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF