Bug #63043

All result returned instead of none

Added by Natalia Postnikova about 7 years ago. Updated about 7 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-11-18
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Function I use in my repository to fetch entries:

public function findByZip($zip, $training = 'all', $state = 0) {
    $query = $this->createQuery();

    $where = $query->equals('zip', $zip);

    $where = $query->equals('show_profile', 1);

    $query->matching($where);
    $query->setOrderings(array('address' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING));

    $result = $query->execute(TRUE);
    print_r($result); die;
    return $result;
}

In my case there is ony one result with this zip, but it has show_profile set to 0. So the result should be 0 entries. But all entries are returned - does not matter if I fetch raw result or as objects. If I comment the line where I check for show_profile, then only one entry is returned - this is the right behaviour.
To sum it up: In case on an empty result all entries are returned.

#1

Updated by Natalia Postnikova about 7 years ago

  • % Done changed from 0 to 100

Please ignore or delete this issue! I forgot to add logicalAnd to my last constraint.

#2

Updated by Wouter Wolters about 7 years ago

  • Status changed from New to Rejected

Also available in: Atom PDF