Project

General

Profile

Actions

Feature #80380

closed

Missing Distinct / GroupBy option in Query

Added by Benjamin Rannow over 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Start date:
2017-03-21
Due date:
% Done:

100%

Estimated time:
PHP Version:
7.1
Tags:
Complexity:
Sprint Focus:

Description

I encounter this Problem under Typo3 8.6.1

my Problem, I try to get objects with a condition which created joins.
my Result contains duplicate Records.

Example:
my Database contains 3 Records (CityA, CityB, CityC)
every city has 2 Pools of Zones which contains some Stores.

Some Stores are zone overlapping, which means,
CityA with innerZone1 contains StoreA and CityB with outerZone3 contains also StoreA

Now i want all Cities with a Specific store.
In our Example "Get all Cities which contains StoreA" will not only Result CityA, CityB ...
the Actual Result is [CityA, CityA, CityB, CityB].

I have no chance to use an GroupBy or Distinct :(
See: https://github.com/brannow/frd_querybug/blob/master/Classes/Domain/Repository/CityRepository.php#L47-L59

For better understanding I created a proof of concept Extension for this behavior.
https://github.com/brannow/frd_querybug


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #80014: Remove extbase ensureCorrectPostOrderingByCategoryTitle testClosedMorton Jonuschat2017-02-25

Actions
Related to TYPO3 Core - Bug #81490: Missing DISTINCT when building query with left joins in extbase repositoryClosed2017-06-06

Actions
Actions #1

Updated by Morton Jonuschat over 7 years ago

  • Tracker changed from Bug to Feature
  • Category changed from Database API (Doctrine DBAL) to Extbase
Actions #2

Updated by Dirk Wenzel over 7 years ago

@Morton Jonuschat
I'd consider this a bug since I did not observe this behaviour in TYPO3 prior to 8.4.

It happens if query constraints on object storage properties are created using the dot syntax:

```
$constraint = $query->logicalOr([
$query->contains('innerZone.stores', $store),
$query->contains('outerZone.stores', $store)
]);
```
see Benjamin Rannows example extension: https://github.com/brannow/frd_querybug/blob/master/Classes/Domain/Repository/CityRepository.php#L45

Actions #3

Updated by Benni Mack over 7 years ago

  • Target version changed from 8 LTS to Candidate for patchlevel
Actions #4

Updated by Oliver Hader over 7 years ago

The behavior has been changed in https://github.com/TYPO3/TYPO3.CMS/commit/c5da264c816b56d1f20ab29e18b6597bb4435534#diff-0eba7a5ae15d87f7b606a6411df68c04L793 when DISTINCT has been removed from the source codes. This change has been releases the first time with TYPO3 CMS 8.4.0

Actions #5

Updated by Oliver Hader over 7 years ago

Just posting this one for the record during analyzing the code
https://github.com/TYPO3/TYPO3.CMS/commit/d64ba0cafacc61c4745c51ec746f77a3ab855065

Actions #6

Updated by Christian Kuhn over 7 years ago

  • Related to Task #80014: Remove extbase ensureCorrectPostOrderingByCategoryTitle test added
Actions #7

Updated by Christian Kuhn over 7 years ago

  • Related to Bug #81490: Missing DISTINCT when building query with left joins in extbase repository added
Actions #8

Updated by Gerrit Code Review over 7 years ago

  • Status changed from New to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #9

Updated by Gerrit Code Review over 7 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #10

Updated by Gerrit Code Review over 7 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #11

Updated by Gerrit Code Review over 7 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #12

Updated by Gerrit Code Review over 7 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #13

Updated by Gerrit Code Review over 7 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #14

Updated by Gerrit Code Review over 7 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #15

Updated by Gerrit Code Review over 7 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #16

Updated by Gerrit Code Review over 7 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #17

Updated by Gerrit Code Review over 7 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #18

Updated by Gerrit Code Review over 7 years ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #19

Updated by Gerrit Code Review over 7 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53670

Actions #20

Updated by Gerrit Code Review over 7 years ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #21

Updated by Gerrit Code Review over 7 years ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #22

Updated by Gerrit Code Review over 7 years ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #23

Updated by Gerrit Code Review over 7 years ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #24

Updated by Gerrit Code Review over 7 years ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #25

Updated by Gerrit Code Review over 7 years ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #26

Updated by Gerrit Code Review over 7 years ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #27

Updated by Gerrit Code Review over 7 years ago

Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #28

Updated by Gerrit Code Review over 7 years ago

Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #29

Updated by Gerrit Code Review over 7 years ago

Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #30

Updated by Gerrit Code Review over 7 years ago

Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #31

Updated by Gerrit Code Review over 7 years ago

Patch set 24 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #32

Updated by Gerrit Code Review over 7 years ago

Patch set 25 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #33

Updated by Gerrit Code Review over 7 years ago

Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53670

Actions #34

Updated by Gerrit Code Review over 7 years ago

Patch set 26 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #35

Updated by Gerrit Code Review over 7 years ago

Patch set 27 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53658

Actions #36

Updated by Gerrit Code Review over 7 years ago

Patch set 3 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53670

Actions #37

Updated by Gerrit Code Review about 7 years ago

Patch set 4 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53670

Actions #38

Updated by Oliver Hader about 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #39

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF