[TYPO3-core] RFC: MM_foreign_select

René Fritz rene at typo3.org
Tue Jan 24 12:39:32 CET 2006


Hi Franz

Thanks very much for your work to review this stuff

> >A TCA config for my solution looks like this
> >
> >'type' => 'group',
> >'internal_type' => 'db',
> >'allowed' => 'tx_dam',
> >'prepend_tname' => 1,
> >'MM' => 'tx_dam_mm_ref',
> >'MM_foreign_select' => 1,
> >'MM_ident' => 'relation_field_or_other_ident',
> >
> >
> >'MM_foreign_select'  switched uid_foreign and uid_local and set tablenames
> > to the local table
>
> Please use 'uid_local' and 'uid_foreign' instead of 'MM_foreign_select'.
> In your case you set:
>
> 'uid_local' => 'uid_foreign',
> 'uid_foreign' => 'uid_local',

Good idea. Will do so but with MM_ prefix.

> 'foreign_table' => 'tt_content'

This is logical but there's already 'allowed' with the same functionality and 
'allowed' is needed anyway so I will stick with that.

So we have

'type' => 'group',
'internal_type' => 'db',
'allowed' => 'tx_dam',
'prepend_tname' => 1,
'MM' => 'tx_dam_mm_ref',
// new options:
'MM_uid_local' => 'uid_foreign',
'MM_uid_foreign' => 'uid_local',
'MM_ident' => 'relation_field_or_other_ident',



> >'MM_ident' defines what value should be written to the "ident" field of
> > the MM table. This is usually the name of the current field.
>
> I think this one is only needed for DAM and nowhere else. So I suggest
> you create a hook function for this. This would be helpful to others who
> want to implement other functionalities with mm tables.

My view:
- I don't see how to implement that as a hook.
- There are people wanting this too
- Kasper introduced a refrences table (for different functionality) which uses 
also this kind of field to reference to a field of a table

Therefore I think that is a must have feature.


>
> >$tcaFieldConf['MM_foreign_select'] = $tcaFieldConf['MM_foreign_select'] ?
> > $table : false;
>
> I think that the $TCA should not be overwritten anywhere, even if it is
> a local copy.
> The $TCA part $tcaFieldConf should have been passed as a reference
> parameter in this function call.
>
> >$dbAnalysis->writeMM($tcaFieldConf['MM'], $id, $prep,
> > $tcaFieldConf['MM_ident'], $tcaFieldConf['MM_foreign_select']);
>
> Please change the order of parameters so that the $tca... are one after
> the other.
> $id should be the first parameter.

This is already a fixed API that can't be changed, sorry.
But when not using MM_foreign_select that have to be changed anyway.

> I cannot understand why  $MMmatchTablenames is assigned the $tablelist.
> You are assigning values to $matchTablenames on different places.

Can't remember :-)
I'll have a look

> Another thing:
> I would like to have the $pid as a column in mm tables in order to make
> them usable for the TCE. If you change the methods now: What about
> adding the $pid as a parameter as well?
> E.g.

Please explain.
The references tables have already a pid, what is the sense of having a pid in 
MM tables?

> Here and somewhere else, as mentioned above, I would like to have the
> hook function, so anybody can extend this to his needs. Instead of
> $ident as a parameter use $additionalArr which will be passed to the
> hook functions together with $insertFields.

I'll have a look, but I'm still unsure if this is easily possible.

Thanks for your remarks. I will review the stuff now.

René

-- 
René Fritz
TYPO3 Association - Active Member
http://association.typo3.org/



More information about the TYPO3-team-core mailing list