Bug #8411

QOM logicalNot() does not work as expected

Added by Andreas Förthner about 5 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2010-06-23
Priority:Must have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Persistence
Target version:TYPO3 Flow Base Distribution - 1.0 alpha 10 Estimated time:3.00 hours
PHP Version: Complexity:
Has patch: Affected Flow version:

Description

$query->logicalNot() seems to be completely ignored. To reproduce that bug you can add a new constraint to the query in BlogRepository->findByBlog():

This works as expected (only posts with the title "FLOW3" are returned):

$query->matching($query->logicalAnd($query->equals('blog', $blog), $query->equals('title', 'FLOW3')))...

This query should return all posts, but not the ones having "FLOW3" as title:

$query->matching($query->logicalAnd($query->equals('blog', $blog), $query->logicalNot($query->equals('title', 'FLOW3'))))...

The second query ignores the title constraint and returns all posts.

Associated revisions

Revision 7dd5ad24
Added by Karsten Dambekalns about 5 years ago

[+BUGFIX] FLOW3 (Persistence): logicalNot() now works, fixes #8411. Some code cleanup along the way.

History

#1 Updated by Karsten Dambekalns about 5 years ago

  • Status changed from New to Accepted
  • Start date deleted (2010-06-21)

#2 Updated by Karsten Dambekalns about 5 years ago

  • Target version set to 1.0 alpha 10
  • Start date set to 2010-06-23

#3 Updated by Karsten Dambekalns about 5 years ago

  • Estimated time set to 3.00

Ok, confirmed. Here's the problem:

To check a value of a certain property we use this logic:
... AND (field = 'title' AND value = 'Test')

Now we wrap this in logicalNot(), basically doing what it should:
... AND (NOT (field = 'title' AND value = 'Test') )

But, we mean:
... AND (field = 'title' AND NOT (value = 'Test') )

#4 Updated by Karsten Dambekalns about 5 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r4636.

Also available in: Atom PDF