Bug #50031
closedOrdering changes result if multilanguage content
0%
Description
Add an order clause changes the results of an extbase query if contents are multilanguages.
Order clause must be on relation content.
In this example (in attachment test_language), an element have one category. The order clause is one the name of the category.
//without/with order $this->elementRepository->setDefaultOrderings(array( 'categorie.nom' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING )); $this->view->assign('elements', $this->elementRepository->findAll());
Result (Exemple in .t3d, visible on content.png):
Default version : Nom Categorie (no ordering) Elément 1 FR Catégorie 1 FR Elemet 2 only FR Catégorie 3 FR Element 3 FR Categorie 2 only FR Element 4 FR Catégorie 3 FR Nom Categorie (ordering on category) Elément 1 FR Catégorie 1 FR Element 3 FR Categorie 2 only FR Elemet 2 only FR Catégorie 3 FR Element 4 FR Catégorie 3 FR English version : Nom Categorie (no ordering) Element 1 EN Categorie 1 EN Elemet 2 only FR Catégorie 3 EN Element 3 EN Categorie 2 only FR Element 4 EN Catégorie 3 EN Nom Categorie (ordering on category) Here the problem ! Element 3 EN Categorie 2 only FR Element 4 EN Catégorie 3 EN
The query generated is (clean of hidden, deleted, startime ...):
FROM tx_testlanguage_domain_model_element LEFT JOIN tx_testlanguage_domain_model_categorie ON tx_testlanguage_domain_model_element.categorie=tx_testlanguage_domain_model_categorie.uid WHERE (tx_testlanguage_domain_model_element.sys_language_uid IN (1,-1) OR (tx_testlanguage_domain_model_element.sys_language_uid=0 AND tx_testlanguage_domain_model_element.uid NOT IN (SELECT tx_testlanguage_domain_model_element.l10n_parent FROM tx_testlanguage_domain_model_element WHERE tx_testlanguage_domain_model_element.l10n_parent>0 AND tx_testlanguage_domain_model_element.sys_language_uid>0))) AND (tx_testlanguage_domain_model_categorie.sys_language_uid IN (1,-1) OR (tx_testlanguage_domain_model_categorie.sys_language_uid=0 AND tx_testlanguage_domain_model_categorie.uid NOT IN (SELECT tx_testlanguage_domain_model_categorie.l10n_parent FROM tx_testlanguage_domain_model_categorie WHERE tx_testlanguage_domain_model_categorie.l10n_parent>0 AND tx_testlanguage_domain_model_categorie.sys_language_uid>0))) ORDER BY tx_testlanguage_domain_model_categorie.nom ASC
But the idea of the query should be:
SELECT DISTINCT tx_testlanguage_domain_model_element.* FROM tx_testlanguage_domain_model_element LEFT JOIN tx_testlanguage_domain_model_categorie ON tx_testlanguage_domain_model_element.categorie=tx_testlanguage_domain_model_categorie.uid WHERE (tx_testlanguage_domain_model_element.sys_language_uid IN (1,-1) OR (tx_testlanguage_domain_model_element.sys_language_uid=0 AND tx_testlanguage_domain_model_element.uid NOT IN (SELECT tx_testlanguage_domain_model_element.l10n_parent FROM tx_testlanguage_domain_model_element WHERE tx_testlanguage_domain_model_element.l10n_parent>0 AND tx_testlanguage_domain_model_element.sys_language_uid>0))) AND (tx_testlanguage_domain_model_categorie.sys_language_uid IN (1,-1) OR tx_testlanguage_domain_model_categorie.sys_language_uid=0) ORDER BY tx_testlanguage_domain_model_categorie.nom ASC
The translated version is specifically search. But not work, if the translated content points on original version of related content.
Element 4 works, it points on the good version of related content. But an order clause should never change the result of query, just the order. And what about the element 2 whose related content is not translated, and so it appears in the result.
Files
Updated by Felix Oertel over 11 years ago
- Category set to Extbase: Generic Persistence
- Status changed from New to Accepted
- Priority changed from Should have to Must have
- Target version set to Extbase 6.2
- Tags set to ecs13ws
Updated by Alexander Opitz over 10 years ago
- Status changed from Accepted to Needs Feedback
Hi,
was this issue fixed or does it still exists?
Updated by Nicolas Forgeot over 10 years ago
Hi,
I test the problem now on 6.2.4, the problem still exist :(
Updated by Nicolas Forgeot over 10 years ago
I made a distribution for showing the problem.
bug_order_multilangue works on a fresh install of TYPO3.
Updated by Alexander Opitz over 10 years ago
- Project changed from 534 to TYPO3 Core
- Category changed from Extbase: Generic Persistence to Extbase
- Status changed from Needs Feedback to New
- Target version changed from Extbase 6.2 to 7.0
- TYPO3 Version set to 6.2
- Is Regression set to No
Updated by Mathias Schreiber over 10 years ago
- Target version changed from 7.0 to 7.1 (Cleanup)
Updated by Benni Mack almost 10 years ago
- Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Wolfram Eberius over 8 years ago
Hi,
so this issue was not fixed and does still exist? At least it seems in our 6.2.25.
Example - this does not sort by the columns of the translations (which we actually want):
SELECT typo3_bugfixes.* FROM typo3_bugfixes WHERE 1=1
AND (typo3_bugfixes.sys_language_uid=-1
OR (typo3_bugfixes.sys_language_uid = 4 AND typo3_bugfixes.l10n_parent=0)
OR (typo3_bugfixes.sys_language_uid=0 AND typo3_bugfixes.uid IN (SELECT typo3_bugfixes.l10n_parent FROM typo3_bugfixes WHERE typo3_bugfixes.l10n_parent>0 AND typo3_bugfixes.sys_language_uid=4 AND typo3_bugfixes.deleted=0)
)
)
AND typo3_bugfixes.pid IN (800)
AND typo3_bugfixes.deleted=0
AND typo3_bugfixes.t3ver_state<=0
AND typo3_bugfixes.pid<>-1
AND typo3_bugfixes.hidden=0
AND typo3_bugfixes.starttime<=1467030840
AND (typo3_bugfixes.endtime=0 OR typo3_bugfixes.endtime>1467030840)
ORDER BY typo3_bugfixes.short_name ASC LIMIT 100
Updated by Markus Klein over 8 years ago
- Status changed from New to Needs Feedback
Maybe solved by #59971?
Updated by Alexander Opitz over 8 years ago
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.