[TYPO3-mvc] tx_extbase_type ignored?

Anja Leichsenring aleichsenring at ab-softlab.de
Thu May 16 16:51:49 CEST 2013


Hi Tomita,

how should this work out of the box? Extension Builder can not know you 
want to use Single Table Inheritence. Here is what you need, have a look 
into Extbase Implementation of Fe_Users and Fe_UserGroups for more details:

TypoScript (see extbase/ext_typoscript_setup.txt):
config.my_ext.persistence {
   classes {
     <Classname_of_class_B> {
       mapping {
         tableName = tx_myext_domain_model_space
         recordType = <whatever you choose here>
       }
     }
   }
}

TCA (see extbase/ext_tables.php):
missing tablefield (probably in sql too)
t3lib_div::loadTCA('fe_users');
if (!isset($TCA['fe_users']['ctrl']['type'])) {
	$tempColumns = array(
		'tx_extbase_type' => array(
			'exclude' => 1,
			'label'   => 
'LLL:EXT:extbase/Resources/Private/Language/locallang_db.xml:fe_users.tx_extbase_type',
			'config' => array(
				'type' => 'select',
				'items' => array(
				 
array('LLL:EXT:extbase/Resources/Private/Language/locallang_db.xml:fe_users.tx_extbase_type.0', 
'0'),
				 
array('LLL:EXT:extbase/Resources/Private/Language/locallang_db.xml:fe_users.tx_extbase_type.Tx_Extbase_Domain_Model_FrontendUser', 
'Tx_Extbase_Domain_Model_FrontendUser')
				),
				'size' => 1,
				'maxitems' => 1,
				'default' => '0'
			)
		)
	);
	t3lib_extMgm::addTCAcolumns('fe_users', $tempColumns, 1);
	t3lib_extMgm::addToAllTCAtypes('fe_users', 'tx_extbase_type');
	$TCA['fe_users']['ctrl']['type'] = 'tx_extbase_type';
}
$TCA['fe_users']['types']['Tx_Extbase_Domain_Model_FrontendUser'] = 
$TCA['fe_users']['types']['0'];

While creating your records you need to set the extbase type to make 
that work.
I link an extension using the fe_users table in this way, perhaps it 
helps you: http://forge.typo3.org/projects/extension-sf_register/repository

Greetings Anja

On 05/16/2013 04:18 PM, Tomita Militaru wrote:
> Hi Anja,
>> Have you configured your extension correctly? With this few
>> informations I can only guess.
> It's mostly what the extension_builder generated, I thought it should
> work out of the box.
>>
>> Please provide TCA, TypoScript and system information / version numbers.
> TCA for Class A: http://pastebin.com/FSTVeKYW
> TCA for Class B: http://pastebin.com/9zKL2FD8
>
> ExtBase 1.3.0
> TYPO3 4.5.25
>
> No special typoscript, only the one generated by EB.
>>
>> Greetings Anja
> Thanks



More information about the TYPO3-project-typo3v4mvc mailing list