[TYPO3-mvc] extbase usage of MM_table_where
Steffen Kamper
info at sk-typo3.de
Wed Nov 4 01:10:37 CET 2009
Hi,
as i just investigated #11168 in core i want to inform you as i have
seen that it'S used wrong in extbase too, here is a copy of my corelist
post:
Hi,
i want to drop this RFC for following reason:
MM_table_where isn't used in core, also not in DAM and their extensions
which uses MM very much.
The whole concept is a bit clouded. MM_table_where is a free
configuration for TCA which is defined as "additional where clause for
MM". So
1) naming is wrong, should be MM_table_andWhere
2) you should use it like 'MM_table_where' => ' AND
tx_dam_mm_cat.uid_foreign!=###THIS_UID###' or simular.
Adding AND here would break other extensions having this defined.
3) totally underdocumented, missing any "real" example. From the naming
you may think, it's simular to "foreign_table_where" which doesn't use
AND, but this is wrong.
Looking to extbase, they also use it the wrong way, look to
Datamp_testcase where they define
'MM_table_where' => 'WHERE 2=2',
I will report it in extbase list.
Joey, please have a look to your tagpack where you use it. Add the AND
in your extension and everything should work fine.
4) Comparing loaddbgroup to the
t3lib_beFunc::exec_foreign_table_where_query only replacing
###THIS_UID### might be too less, there you see also other placeholders
like ###CURRENT_PID###, ###THIS_CID###, ###STORAGE_PID### etc.
maybe we need real usecases to see what makes sense here, but for me it
looks bit inconsistent.
Sry for writing long story, but i think this shows how it works. As
nobody else complaint i think this is used very seldom. Anybody who
configured MM in TCA know the many hours of try&error until
configuration works as expected. Don't misunderstand, for core cases it
works, but core has no real MM defined, this is something for
extensions, and of course extbase which has to deal with that in datamapper.
I hope this helps understanding of the handling in loaddbgroup and helps
fixing it in extbase (remember adding " AND")
vg Steffen
More information about the TYPO3-project-typo3v4mvc
mailing list