[TYPO3-english] ke_stats AND dbal
Christian Buelter
buelter at kennziffer.com
Mon Jun 21 15:59:18 CEST 2010
Hi,
I really must confess I did not test it with dbal.
If someone want's to write a patch, I'll happy to include it.
Please use http://forge.typo3.org/projects/extension-ke_stats/issues
Greetings,
Christian
Am 21.06.2010 15:42, schrieb Gulay Boris:
> Thank you for your reply. I've forwarded it with my comments to extension
> developer.
>
> On Sun, 20 Jun 2010 00:50:28 +0200, Xavier Perseguers
> <typo3 at perseguers.ch> wrote:
>> Hi,
>>
>> Gulay Boris wrote:
>>> I have installed typo3 (4.3.3) with dbal (I use Postgres as database
>>> storage). Also I have installed ke_stats extension. When I click
>>> "Statistics" menu item in BE I see an error:
>>>
>>> "Could not parse where clause in
>>> /usr/share/typo3/typo3/sysext/dbal/class.ux_t3lib_db.php : 1073"
>>>
>>> Where clause that ke_stats passes to dbal really seems incorrect:
>>>
>>> "whereclause='type=''pages'' AND category=''pages'' AND year=2009 AND
>>> month=6 AND tx_kestats_statdata.element_uid IN (2,4,5,6,7,8)' AND
>>> groupby='' AND orderby='counter DESC'"
>>>
>>> What is wrong with ke_stats extension?
>>
>> I don't know this extension but as you pointed out the query seems to be
>
>> completely broken. I just had a look at mod1/index.php from TER as you
>> said it is a BE problem which redirected me to
>> lib/class.tx_kestats_lib.php.
>>
>> Problem is located with the method getStatResults which takes an
>> optional argument $orderBy (e.g.) which defaults to
>>
>> $orderBy='counter DESC'
>>
>> and this is used as this:
>>
>> $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_kestats_cache',
>> 'whereclause=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($where_clause,
>> 'tx_kestats_cache')
>> . ' AND groupby=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($groupBy,
>> 'tx_kestats_cache')
>> . ' AND orderby=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($orderBy,
>> 'tx_kestats_cache') );
>>
>> which means the whole argument is quoted (including the DESC part). The
>> author wanted to make it well for DBAL but had no real clue what was
>> going on. With MySQL nothing is quoted in fact and it works but this
>> extension is not really DBAL-compliant, that's all.
>>
>> Regards
More information about the TYPO3-english
mailing list