[TYPO3-dam-devel] RFC Bugfix: 6639: SQL errors when using List module to create new item

Peter Kühn peter.kuehn at wmdb.de
Sat Dec 29 13:10:52 CET 2007


Ola!

did i get this right? the reason why i tried to reproduce the bug for 
about half an hour without success is, that it only exists in version 
1-0 - the one we want to release asap with the version we´re working on? ;)
do i really have to setup a historical version to prove a fix for a 
historical bug?

You're not serious, are you?

pekue

Michiel Roos schrieb:
> Hi,
> 
> This is a svn patch request.
> 
> Type: bugfix
> 
> Problem: SQL errors are thrown when creating a new media record from 
> list mode.
> 
> Cause:
> tx_dam_fileUsage calls getMediaUsageReferences with a uid like: 
> 'NEW9834759453987'. This confuses getMediaUsageReferences in a bad way. 
> It tries to control its own sanity by cleaning the passed in uidlist using:
> $GLOBALS['TYPO3_DB']->cleanIntList($uidList)
> 
> That comes out '0' (zero).
> 
> No other parameters are passed in, so the resulting $where ends up empty 
> and the query fails.
> 
> Responsibility lies with tx_dam_fileUsage which should not try to get 
> 'media usage references' for a non exising record.
> 
> The attached patch checks if we are dealing with a new record using:
>    if (strstr('NEW', $PA['row']['uid']) != '') {
>       // get the media file ref
>    }
> 
> Branches:
> 1-0
> Not present in trunk.
> 
> Kind regards,
> 
> 
> Michiel Ros
> 
> 
> ------------------------------------------------------------------------
> 
> --- lib/class.tx_dam_tcefunc.php	2007-12-25 04:06:06.000000000 -0500
> +++ lib/class.tx_dam_tcefunc.fix.php	2007-12-25 04:06:22.000000000 -0500
> @@ -837,7 +837,9 @@
>  		$itemOut = '';
>  
>  		$itemOut .= '<h4>'.$LANG->sl('LLL:EXT:dam/lib/locallang.xml:fileReference').'</h4>';
> -		$rows = tx_dam_db::getMediaUsageReferences($PA['row']['uid'], '');
> +		if (strstr('NEW', $PA['row']['uid']) != '') {
> +			$rows = tx_dam_db::getMediaUsageReferences($PA['row']['uid'], '');
> +		}
>  
>  		for ($index = 0; $index < 2; $index++) {
>  


More information about the TYPO3-team-dam mailing list