[TYPO3-mvc] select fe_users of certain usergroups

Georg Schönweger georg.schoenweger at gmail.com
Mon May 30 10:31:58 CEST 2011


it seems this is a bug in typo3 core, all query parts before the last
"contains" part get lost! I created a ticket in forge;
http://forge.typo3.org/issues/27134

- Georg

Am 27.05.2011 17:25, schrieb Georg Schönweger:
> Hi,
>
> i have to query if a fe_user is a Member of a certain usergroups. So for
> example i have to select all fe_users which are members of usergroup=1
> OR usergroup=2 ... my query looks like this;
> $query->matching(
>   $query->logicalOr(               
>     $query->contains('usergroup',1),
>     $query->contains('usergroup',2)
>   )
> );
>
> i checked now the raw sql statement of this query; it is ...
> (FIND_IN_SET(2, fe_users.usergroup) ... the first "contains" statement
> is ignored! is this a bug?
> for testing i tried
> $query->matching(
>   $query->logicalOr(               
>     $query->equals('usergroup',1),
>     $query->equals('usergroup',2)
>   )
> );
>
> .. this is working like expected, but does not fit my needs...
>
>
> BTW. whats the best method to debug Database operations with extbase? if
> i do print_r i get blank screen .. i read this is because of Dependency
> Injection .. so i did a dirty hack ba adding
>         if($from_table == "fe_users") {
>             echo($where_clause."<br>");
>         }
> to class.t3lib_db.php .. Maybe some notes about the blank screen with
> dependency injection issue and also how to debug such stuff should be
> added to forge wiki! It is really frustrating if your database
> operations do not work and you can't debug them.
>
> - Georg
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list