Issue Bug Closed

#84707Extbase wrongly counting translated objects

Kevin Ditscheid 04/12/18, 22:49 updated 02/24/19, 11:56

Description

When doing $this->repository->countBySomeField($fieldValue); the result counting consist of default language records. This is problematic, because – depending on the language overlay mode – the result of $this->repository->findBySomeField($fieldValue); could return a different result set. The method doLanguageAndWorkspaceOverlay could remove non localized records that got included in the counting.
This behavior breaks pagination logic for example, where a general result count must be generated in order of calculating a pagination. It could lead to orphan pages, because the actual resultset of findBy is different then the result of countBy.

Steps to reproduce:

1) Create an extension with domain records and a list view
2) Fetch a result set via $this->repository->findBy and $this->repository->countBy and give them to your view
3) Create a few records in default language
4) Translate some of them (not all!)
5) Call the list view in the translation language and check the results of findBy and countBy

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.