Bug #84707
closedExtbase wrongly counting translated objects
0%
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