[TYPO3-dam-devel] RFC Bugfix: 6766: getReferencedFiles $whereClauses as string

Andreas Balzer andreasbalzer at gmail.com
Thu Dec 27 15:16:58 CET 2007


+1

On Dec 27, 2007 1:29 PM, Michiel Roos <michiel at netcreators.com> wrote:

> Hi,
>
> This is a svn patch request.
>
> Type: bugfix
>
> Problem:
> Nonsensical preg_replace in lib/class.tx_dam_db.php:
>
> preg_replace('^AND ', trim($whereClauses))
>
> That's a no-op -> error. preg_replace takes three parameters. Gathering
> from the context of the function the line should read (strip off the AND
> if it exists):
>
> preg_replace('/^AND /', '', trim($whereClauses));
>
>
>
> Branch: 1-0
>
> Ref: http://bugs.typo3.org/view.php?id=6766
>
> NOTE: The trunk is fine. This one needs +2 to get applied to the 1-0
> branch!
>
> Kind regards,
>
>
> Michiel Roos
>
> --
> Netcreators BV :: creation and innovation
> www.netcreators.com
>
> Interesse in werken bij Netcreators?
> http://www.netcreators.com/bedrijf/vacatures/
>
>
> diff -ru ../dam.1-0/lib/class.tx_dam_db.php ./lib/class.tx_dam_db.php
> --- ../dam.1-0/lib/class.tx_dam_db.php  2007-12-25 00:12:08.000000000-0500
> +++ ./lib/class.tx_dam_db.php   2007-12-25 00:29:55.000000000 -0500
> @@ -451,7 +451,7 @@
>         */
>        function getReferencedFiles($foreign_table='', $foreign_uid='',
> $MM_ident='', $MM_table='tx_dam_mm_ref', $fields='', $whereClauses=array(),
> $groupBy='', $orderBy='', $limit=1000) {
>
> -               $whereClauses = is_array($whereClauses) ? $whereClauses :
> array('where' => (preg_replace('^AND ', trim($whereClauses))));
> +               $whereClauses = is_array($whereClauses) ? $whereClauses :
> array('where' => (preg_replace('/^AND /', '', trim($whereClauses))));
>
>                $fields = $fields ? $fields :
> tx_dam_db::getMetaInfoFieldList();
>                $local_table = 'tx_dam';
> @@ -1056,4 +1056,4 @@
>
>  include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dam/lib/class.tx_dam_db.php']);
>  }
>
> -?>
> \ No newline at end of file
> +?>
>
> _______________________________________________
> TYPO3-team-dam mailing list
> TYPO3-team-dam at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-dam
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.netfielders.de/pipermail/typo3-team-dam/attachments/20071227/0ffa47f0/attachment.htm 


More information about the TYPO3-team-dam mailing list