Bug #64853
closedAdding new fields for the same table with two extension
0%
Description
I have two extension those adds fields to same table.
For Typo3 version 4.2 all is well, But after migrating to version 6.2 of typo3 only fields added by an extension will be visible and others fields added by other extension will be invisible.
If I install a single extension then their fields visible. But if I install the two extensions only the fields added by one of them will be visible and the other fields will be invisible.
- extension_1: ext_tables.php
t3lib_div::loadTCA('table_name'); t3lib_extMgm::addTCAcolumns('table_name',$tempColumns,1); t3lib_extMgm::addToAllTCAtypes('table_name','tx_myext_newfield1');
- extension_2: ext_tables.php
t3lib_div::loadTCA('table_name'); t3lib_extMgm::addTCAcolumns('table_name',$tempColumns,1); t3lib_extMgm::addToAllTCAtypes('table_name','tx_myext_newfield2');
I have to change my code and still same problem.
t3lib_div::loadTCA('table_name'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('table_name',$tempColumns); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('table_name','tx_myext_newfield1'); t3lib_div::loadTCA('table_name'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('table_name',$tempColumns); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('table_name','tx_myext_newfield2');
Updated by Markus Klein almost 10 years ago
- Category deleted (
Backend User Interface) - Status changed from New to Needs Feedback
- Assignee deleted (
Bilel ELLOUZE)
Hi!
First of all please ask such questions in the forums or mailing lists first, since this is the bug tracker. You might figure out a solution in the forum much easier as there're more people around.
To your problem:- Please study the changes since 4.2 extensively. There are lightyears between this version and 6.2.
- Remove all calls to t3lib_div::loadTCA('table_name'); This method is deprecated and was removed with version 7.0.
- Since 6.2 the handling of the TCA is vastly optimized and provides a new approach: http://docs.typo3.org/typo3cms/TCAReference/ExtendingTca/StoringChanges/Index.html#storing-changes-extension-overrides
There is one pitfall though: If the TCA of the table you're extending is defined in ext_tables.php (the old way; not in Configuration/TCA/<table>.php) the approach with TCA overrides does not work. You have to do the overriding in ext_tables.php as well.
So depending on which table you're extending you should choose the override-approach whenever possible.
Side-note: In 6.2 you may still use the old class names (like t3lib_extMgm), so you're not forced to convert to the new ones. But of course we encourage people to do so.
Did you set the dependency correctly in emconf of extension_1 and extension_2? They should both have a dependency on the extension who's table they are extending.
Updated by Bilel ELLOUZE almost 10 years ago
Sorry, this is the first time that I write here.
Thank you for your help. My problem is solved after the addition of dependence in the extension 2.
'depends' => array( '*extension*' => '', ),
Updated by Xavier Perseguers almost 10 years ago
- Status changed from Needs Feedback to Closed
Fine then.