[TYPO3-mvc] Complex query just not working

Georg Schönweger georg.schoenweger at gmail.com
Wed Jul 13 08:41:24 CEST 2011


Hi,

Typo3 4.5.3 has a bug (which is fixed in 4.5.4) when using
$query->contains() ... see http://forge.typo3.org/issues/25488 ... Maybe
this is the problem?

- Georg

Am 13.07.2011 01:03, schrieb Thomas "Thasmo" Deinhamer:
> Franz Koch schrieb:
>> I'm sorry, but the nesting of your statements looks wired. I stripped it
>> down to what would make sense to me if I got you right, but I'm not sure
>> if the "->in()" constraints will work correctly for the categories (in
>> doubt do as you did before). Also I'm half asleep - so it might be
>> totally nonsense ;)
>>
>> http://pastebin.com/dxepmqeQ
>
> Hey, thanks for your reply!
>
> Actually this is very weird.
>
> This case works (only include* fields used):
> $constraint = $query->logicalOr(
>     $query->in('includedCategories.uid', $categories),
>     $query->contains('includedProducts', $product)
> );
>
> But when I'm adding the "AND NOT" part, the query doesn't
> find any discounts, although the 'exclude*' fields are
> empty in all stored discounts. That's pretty weird.
>
> This case does not work (include and exclude fields used):
> $constraint = $query->logicalAnd(
>     $query->logicalOr(
>         $query->in('includedCategories.uid', $categories),
>         $query->contains('includedProducts', $product)
>     ),
>     $query->logicalNot(
>         $query->logicalOr(
>             $query->in('excludedCategories.uid', $categories),
>             $query->contains('excludedProducts', $product)
>         )
>     )
> );
>
> Is this weird? Any ideas?
>
> Regards,
> Thomas
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list