[Typo3-dev] MM relationships both ways

dan frost dan at danfrost.co.uk
Mon Sep 27 12:54:20 CEST 2004


I want to do this:

Add field to fe_users, "account"

Add table "account" with field "fe_users"

I want to be able to set the account an fe_user record is in *from* the 
fe_user record.

AND

I want to be able to set the users that are in an account *from* an 
account record.


SO:

If i set both the account's "fe_users" field AND the fe_user field 
"account" to look at the same MM table (e.g. tx_eg_account_users_mm) 
then it doesn't work - when editing the fe_users table the record thinks 
that uid_local relates to fe_users.uid. When editing an account record 
the record thinks uid_local relates to account.uid.

How about:
in t3lib_loaddbgroup you change the lines like:
190: $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $tableName, 
'uid_local='.intval($uid), '', 'sorting');

To something like:

190: $uid_local_field = 
isset($GLOBALS['TCA'][$tName]['ctrl'][someField]['config']['uid_local']) 
? $GLOBALS['TCA'][$tName]['ctrl'][someField]['config']['uid_local'] : 
'uid_local';
191: $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $tableName, 
$uid_local.'='.intval($uid), '', 'sorting');

I'm going to do an XCLASS - but may we could extend this idea to a few 
other things.

Or should i do it with the DBAL?

dan




More information about the TYPO3-dev mailing list