[TYPO3-core] RFC: bug #549

Franz Holzinger franz at fholzinger.com
Mon Feb 27 11:04:46 CET 2006


Hello Wolfgang,

>>>$page_propArr
>>>      
>>>
>>this kind of naming is not wanted here.
>>    
>>
>
> Do you like $pagePropArr more?
>  
>
that's good.

> 
>  
>
>>You have the line
>>
>>    
>>
>>>$GLOBALS['TYPO3_DB']->exec_DELETEquery($table, 'uid='.intval($uid));
>>>      
>>>
>>which will call:
>>
>>    
>>
>>>    function DELETEquery($table,$where)    {
>>>        if (is_string($where))    {
>>>
>>>                // Table and fieldnames should be "SQL-injection-safe"
>>>when supplied to this function
>>>            $query = 'DELETE FROM '.$table.
>>>                (strlen($where)>0 ? '
>>>                WHERE
>>>                    '.$where : '');
>>>
>>>      
>>>
>>And after it you have coded:
>>
>>    
>>
>>>$propArr = $this->getRecordProperties($table, $uid);
>>>      
>>>
>>which will call
>>
>>    
>>
>>>    function recordInfo($table,$id,$fieldList)    {
>>>        global $TCA;
>>>        if (is_array($TCA[$table]))    {
>>>            $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fieldList,
>>>$table, 'uid='.intval($id));
>>>            if ($GLOBALS['TYPO3_DB']->sql_num_rows($res))    {
>>>                return $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
>>>            }
>>>        }
>>>    }
>>>      
>>>
>>So how should this work when the record with this uid has already been
>>deleted before?
>>    
>>
>
> It works because all the methods do not check if the deleted flag is
> set, I tried it out before posting this patch here,
> you didn't obviously.
>
>  
>
I want to understand it from the code and have lack of time to test it.

Can you please explain this again?
You have

DELETE FROM table where uid=345

and then

SELECT FROM table where uid=345




Greets,

Franz










More information about the TYPO3-team-core mailing list