CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Bug #31226

Sorting of translated categories in list view

Added by Roman Schürmann over 1 year ago. Updated 10 months ago.

Status:Under Review Start date:2011-10-24
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:Bug Spent time: 0.10 hour
Target version:-
Votes: 0

Description

If a list of translated products is shown list view, the order depents on the original order of not the translated products. This means the list isn't sorted alphabetically.

patch_31226.patch (1.6 kB) Roman Schürmann, 2011-10-27 11:32

class.tx_commerce_db_category.patch (2.1 kB) Georg Schönweger, 2012-07-31 16:35

History

Updated by Roman Schürmann over 1 year ago

If a list of translated products is shown list view and the option: sortAllitems.type=alphabetiDesc
is choosen, the order of the translated products is like the order of not the translated products.
This means the list isn't sorted alphabetically anymore.

Updated by Roman Schürmann over 1 year ago

Updated by Ingo Schmitt 12 months ago

  • Status changed from New to Resolved

Fixed in TRUNK

Updated by Georg Schönweger 10 months ago

Sry but this change should be reverted/changed because;
a) function get_child_categories(): it will sort ALWAYS categories by title (when using multiple languages and current language is not default language). I guess most users do not want this behaviour ...
b) function get_child_products(): when current language is default language it will double query the products

IMO standart way of sorting translated items is to use the sorting of default language, so this patch does not make sense for me.
Sorting by title is a special case and should be queried and only then it should use different sorting for translated items.
Think also about shops which are NOT using "hideNonTranslated" mode (see http://forge.typo3.org/issues/31772). It will become difficult to handle this translation mode when translated items are sorted different than default ones.

Because sorting by title is a special case it should be done by using hooks.
For Products there exists already a hook which could be used for this; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/lib/class.tx_commerce_db_category.php']['productQueryPostHook']
For Categories a hook could be added.

Attached patch introduces new hook categoryQueryPostHook for this purpose and deletes changes from patch file patch_31226.patch.

Also available in: Atom PDF