[TYPO3-english] pi_list_query (pi_exec_query) does not take into account the groupby clause when count is enabled

Jochem Nabuurs jochem at roquin.nl
Tue Jul 13 11:04:50 CEST 2010


Jigal van Hemert wrote:
> Jochem Nabuurs wrote:
>> can anybody tell me why pi_list_query does not take into account the 
>> groupby clause when count is enabled. Is this a performance related 
>> design choice? I'm no mysql guru so I guess there is a good explaination.
> 
> The PHPdoc comments say that pi_list_query is deprecated since 3.6 (!). 
> Unfortunately it is not logged in the deprecation log, so I doubt that 
> it will be removed in 4.5 (also because 4.5 will be the Long Term 
> Support version).
> 
> Strangely enough it suggests to use pi_exec_query(), which uses 
> pi_list_query to build the query parameters.
> 
> It's better to use the t3lib_DB functions for queries IMO.
> 
>> The reason why I'm asking this is while I was playing with the 
>> dam_downloads extension I noticed duplicate records in the listView 
>> mode. This was caused by files having multiple DAM categories 
>> assigned. Therefore they where displayed for each category assigned to 
>> the file.
>> The extension uses pi_exec_query to list results, but does it 
>> incorrect, according to my findings.
> 
> Well, you probably know the way to go :-) Bug report, maybe a patch...
> 
I totally agree with you, Jigal. The t3lib_DB functions are better to be 
used because they provide more flexibility amongst others.

The extension is last updated on 12-05-2006 so I doubt the author of the 
extension will provide a patch, but I'll notify him/her anyway. The 
extension is not listed in the bugtracker so that won't work either. Or 
maybe someone can add the project (I don't know how)?

In case the above isn't effective, could someone please point me to the 
correct location for supplying a patch of some sort.

Thanks in advance

Jochem Nabuurs



More information about the TYPO3-english mailing list