[TYPO3-team-templavoila] RFC: #2081: Using static DSes for Page and FCE

Steffen Kamper info at sk-typo3.de
Fri Jan 1 23:39:24 CET 2010


Hi Xavier,

Xavier Perseguers schrieb:
> Hi Steffen,
> 
> First of all, happy new year to all readers!
>

yes, happy new year to all!

> I just had a quick look at code in order to see whether it may work with 
> DBAL. I see two problems (example in following snippet):
> 
> On 12/30/09 6:08 PM, Steffen Kamper wrote:
>> +                $res = $TYPO3_DB->exec_SELECTquery (
>> +                    '*, IF(LOCATE("(fce)", datastructure)>0,2,1) scope',
>> +                    'tx_templavoila_tmplobj',
>> +                    'pid IN ('.$this->storageFolders_pidList.') AND 
>> datastructure!=""'.
>> +                        
>> t3lib_BEfunc::deleteClause('tx_templavoila_tmplobj').
>> +                        
>> t3lib_BEfunc::versioningPlaceholderClause('tx_templavoila_tmplobj'),
>> +                    '',
>> +                    'scope,title'
>> +                );
> 
> Problem 1: LOCATE is not (yet) supported. I may add support for it (for 
> DBAL 1.1.x, that is TYPO3 4.4.0 and above) but I would like you to add a 
> feature request/bug entry for project DBAL with a relation to this RFC.
> 
> Problem 2: IF(LOCATE("(fce")"... or datastructure!="" is not using the 
> TYPO3_DB API 100% properly as embedded strings should be quoted using 
> $GLOBALS['TYPO3_DB']->fullQuoteStr:
> 
> $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
>     '*, IF(LOCATE(' . $GLOBALS['TYPO3_DB']->fullQuoteStr('(fce)', 
> 'tx_templavoila_tmplobj') . ', datastructure)>0,2,1) scope',
>     'tx_templavoila_tmplobj',
>     'pid IN (' . $this->storageFolders_pidList . ') AND datastructure!=' 
> . $GLOBALS['TYPO3_DB']->fullQuoteStr('', 'tx_templavoila_tmplobj') .
>         t3lib_BEfunc::...
> );
> 
> In addition, I found that existing code declared "global $TYPO3_DB" 
> which should be avoided with current CGL.
>

i'm not happy with the existing solution as only place for scope now is 
in the ds title, which is not good at all. But TO has no connection to 
the scope.
So there is a real drawback for database actions based on TO records.

I don't have a real good idea yet, but i will use your suggested quoting 
until a better solution is there.

> Problem 3: Don't know if it's really has an impact, I guess no but as 
> you updated class.tx_templavoila_extdeveval.php, I just discovered that 
> this class is not DBAL compliant as queries are created completely and 
> executed with $GLOBALS['TYPO3_DB']->sql_query() which is not recommended 
> (exec_* methods should be used instead) and there are a few dependencies 
> to MySQL when methods not part of the DB API are used:
> 

this class is really old and not changed for a long time. I only changed 
all relevant functions for staticDS. Rest of cleanup will be done in 1.5

vg Steffen


More information about the TYPO3-team-templavoila mailing list