[TYPO3-mvc] Fetching FEUsers related to FEUserGroup

Alex Bailey alex at lastmancoding.com
Fri Dec 10 09:29:05 CET 2010


SELECT fe_users.* FROM fe_users WHERE (fe_users.usergroup LIKE '%,14,%' 
OR fe_users.usergroup LIKE '%,14' OR fe_users.usergroup LIKE '14,%') 
AND fe_users.deleted=0 AND fe_users.disable=0 AND 
(fe_users.starttime<=1291969380) AND (fe_users.endtime=0 OR 
fe_users.endtime>1291969380) AND fe_users.pid IN (102, 343)

I just noticed the mistake: the condition for checking if 
fe_users.usergroup only contains a single value like 14 is missing.
Only ,14 ,14, and 14, are used.

SELECT fe_users.* FROM fe_users WHERE (fe_users.usergroup LIKE '%,14,%' 
OR fe_users.usergroup LIKE '14' OR fe_users.usergroup LIKE '%,14' OR 
fe_users.usergroup LIKE '14,%') AND fe_users.deleted=0 AND 
fe_users.disable=0 AND (fe_users.starttime<=1291969380) AND 
(fe_users.endtime=0 OR fe_users.endtime>1291969380) AND fe_users.pid IN 
(102, 343)

fixes the problem but how do I get extbase to do that on it's own :)

I'll try to figure out.

Thanks for the tip.

Regards,

Alex



More information about the TYPO3-project-typo3v4mvc mailing list