[TYPO3-dev] Symmetric bidirectional MM ralations on the same table

Jochen Rieger j.rieger at connecta.ag
Fri Feb 25 15:58:28 CET 2011


Hi Stefano,

> what's the sql for your table tx_myext_characters_rel_mm ? has it a TCA
> definition?
> where do you have those 'character1' and 'character2' fields?

yes, the mm table has a TCA definition in this case:

-- snip --
$TCA['tx_myext_characters_rel_mm'] = array (
	'ctrl' => $TCA['tx_myext_characters_rel_mm']['ctrl'],
	'interface' => array (
		'showRecordFieldList' => 'hidden'
	),
	'feInterface' => $TCA['tx_myext_characters_rel_mm']['feInterface'],
	'columns' => array (
		't3ver_label' => array (
			'label'  => 'LLL:EXT:lang/locallang_general.xml:LGL.versionLabel',
			'config' => array (
				'type' => 'input',
				'size' => '30',
				'max'  => '30',
			)
		),
		'hidden' => array (
			'exclude' => 0,
			'label'   => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
			'config'  => array (
				'type'    => 'check',
				'default' => '0'
			)
		),
		'character1' => array (
			'exclude' => 0,
			'label' => 
'LLL:EXT:myext/locallang_db.xml:tx_myext_characters_rel_mm.character1',
			'config' => array (
				'type' => 'group',
				'internal_type' => 'db',
				'allowed' => 'tx_myext_characters',
				'size' => 1,
				'minitems' => 0,
				'maxitems' => 1,
			)
		),
		'character2' => array (
			'exclude' => 0,
			'label' => 
'LLL:EXT:myext/locallang_db.xml:tx_myext_characters_rel_mm.character2',
			'config' => array (
				'type' => 'group',
				'internal_type' => 'db',
				'allowed' => 'tx_myext_characters',
				'size' => 1,
				'minitems' => 0,
				'maxitems' => 1,
			)
		),
		
		'sorting_char1' => Array (
             'config' => Array (
				'type' => 'passthrough',
             )
         ),
         'sorting_char2' => Array (
             'config' => Array (
            		'type' => 'passthrough',
             )
         ),
	),
	'types' => array (
		'0' => array('showitem' => 'hidden;;1;;1-1-1,  character1, character2)
	),
);
-- snap --

But of cause it's not edited as an own record. Just by editing the 
character records to be found in tx_myext_characters.

Also, of cause you need the part to be found in ext_tables.php. But this 
one contains nothing special... just the standards.

Maybe now you'll get it to work? :)

Cheers,
Jochen




More information about the TYPO3-dev mailing list