[TYPO3-mvc] $query->contains('feUser.usergroup', $myGroup) creates incorrect SQL syntax

Marc Bastian Heinrichs typo3 at mbh-web.de
Thu Jan 19 10:42:50 CET 2012


Hey Dominic,

> in my repository I have a entity with a 1:1 relation to fe_users and 
> want to filter all of the entities where its user is in a certain group. 
> But the query
> 
> $query = $this->createQuery();
> $constraint = $query->contains('feUser.usergroup', $group);
> $query->matching($constraint);
> return $query->execute();
> 
> Results in a incorrect syntax: in the join and in the column names the 
> table fe_users is missing. Here the sql error:
>  
> [...]
> 
> So the table fe_users is missing in the JOIN and in the WHERE clause. If 
> I add it manually in a sql browser its valid and working.
> 
> Is this a bug or is it not possible in the way I do it?

Could you post your tca and your model properties? And which version do
you use?


Best
Marc Bastian


More information about the TYPO3-project-typo3v4mvc mailing list