@@ -803,15 +810,15 @@ class Doctrine_Query extends Doctrine_Access {
break;
caseDoctrine_Relation::MANY_AGGREGATE:
caseDoctrine_Relation::MANY_COMPOSITE:
$b=array_shift($a);
$b=array_shift($a);
$b=$fk->getTable()->getComponentName();
$graph=newDoctrine_Query($this->session);
$graph->parseQuery("FROM $b-l WHERE $where");
$where=$this->tables[$root]->getTableName().".".$this->tables[$root]->getIdentifier()." IN (SELECT ".$fk->getLocal()." FROM ".$asf->getTableName()." WHERE ".$fk->getForeign()." IN (".$graph->getQuery()."))";