[TYPO3-dam] mmforeign causes troubles...

Franz Koch typo3 at fx-graefix.de
Thu Apr 20 11:37:35 CEST 2006


Hi Ernesto,

> In file ext/mmforeign/class.ux_t3lib_loaddbgroup.php around line 241
> there is:
> 
>         if ($MMtable)   {   // If MM, then call this function to do that:
> 
>                 // used here to get defVals when set - [tablename]_[id]
>             if($itemlist) {
>                 $this->readList($itemlist);
> 
> This call to $this->readList($itemlist) is not correct, as the
> "$itemlist" will be loaded with the content of the original field, which
> in MM-relation-fields is always the COUNT of how many related items we
> have, and not the comma-separated item-list itself. This means, in case
> of one category stored in the MM-relation would mean loading the
> category with uid "1" in this field (similary, if you have 2 categories,
> the category with uid "2" will be loaded too). Commenting out or
> removing this line makes it "behave" again.
> 
> Took me some time to find out the bug, but then I also learned some more
> stuff about the internals of TYPO3 (and made me wonder if a
> "refactoring" is really possible...).

I also found a relation to this call and removed it temporary, but as Pieter has allready replied - there is no more category showing up in tt_news.

I included some "debug($whatever)" to see what is happening, and it seems that the categorylist get's fetched three times (as every group-field of the news-record). The first time it returns the correct category, but the other times uid='categorycount' is returned and added as you described.

-- 
Kind regards,
Franz Koch



More information about the TYPO3-project-dam mailing list