Project

General

Profile

Actions

Bug #50031

closed

Ordering changes result if multilanguage content

Added by Nicolas Forgeot almost 11 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2013-07-15
Due date:
% Done:

0%

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

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

test_language_0.0.0.zip (105 KB) test_language_0.0.0.zip Nicolas Forgeot, 2013-07-15 15:12
T3D__2013-07-15_14-09-z.t3d (2.17 KB) T3D__2013-07-15_14-09-z.t3d Nicolas Forgeot, 2013-07-15 15:12
config.ts (654 Bytes) config.ts Nicolas Forgeot, 2013-07-15 15:12
content.png (72 KB) content.png Nicolas Forgeot, 2013-07-15 15:12
content.png (87 KB) content.png Nicolas Forgeot, 2013-07-15 15:13
bug_order_multilangue.zip (116 KB) bug_order_multilangue.zip Nicolas Forgeot, 2014-09-24 14:40

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #59971: Reset languageMode query setting for child object queries in ExtbaseRejected2014-06-29

Actions
Actions #2

Updated by Felix Oertel almost 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
Actions #3

Updated by Alexander Opitz over 9 years ago

  • Status changed from Accepted to Needs Feedback

Hi,

was this issue fixed or does it still exists?

Actions #4

Updated by Nicolas Forgeot over 9 years ago

Hi,

I test the problem now on 6.2.4, the problem still exist :(

Actions #5

Updated by Nicolas Forgeot over 9 years ago

I made a distribution for showing the problem.

bug_order_multilangue works on a fresh install of TYPO3.

Actions #6

Updated by Alexander Opitz over 9 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
Actions #7

Updated by Mathias Schreiber over 9 years ago

  • Target version changed from 7.0 to 7.1 (Cleanup)
Actions #8

Updated by Benni Mack almost 9 years ago

  • Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
Actions #9

Updated by Susanne Moog almost 9 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #10

Updated by Benni Mack over 8 years ago

  • Target version deleted (7.5)
Actions #11

Updated by Wolfram Eberius almost 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

Actions #12

Updated by Markus Klein almost 8 years ago

  • Status changed from New to Needs Feedback

Maybe solved by #59971?

Actions #13

Updated by Alexander Opitz over 7 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.

Actions

Also available in: Atom PDF