In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
1366 [In-Portal CMS] Data Management bug report always 2012-07-22 08:44 2012-07-25 05:29
alex  
alex  
normal  
closed 5.2.0-RC1  
fixed  
 
none 5.2.0  
https://groups.google.com/d/topic/in-portal-bugs/si_JGDz38do/discussion
Fixes problem with multilingual field not being sorted including fallback code
1
0001366: Multilingual field sorting not working in some cases
In-Portal can operate on single record (via kDBItem class) and on lists/grids (via kDBList class). For lists additionally sorting can be specified in following ways:

* via "ListSortings -> ForcedSorting" setting (in unit config), which defines sorting that is always in effect and can't be changed by user (usually by Priority field)
* via "ListSortings -> Sorting" setting (in unit config), which defines default sorting for a list of none was set by user
* via configuration settings from SystemSettings database table, which is same as sorting above, but can be changed any time without a need to edit PHP files of that unit config
* via kDBList::AddOrderField method call from PHP, which accompanies default sorting (added after/before it), that comes all places described above

All sortings of described above are added via kDBList::AddOrderField method eventually and he does 2 things:

* if field isn't translatable then leave it's name as is
* if field is translatable and language is indicated (e.g. l2_Name), then we sort by this field value only
*if field is translatable and language isn't indicated (e.g. Name), then we sort by this field value with fallback to primary language

All seems to be working normally until we start to work with multilingual fields. With multilingual fields we have field value split across N fields (1 field for each language).

Method kDBList::AddOrderField can handle all cases, but all mentions of translatable fields in unit config are pre-processed by kMultiLanguage formatter resulting in "Name" in "ListSortings" setting to be replaced with "l1_Name" and this way disabling fallback to primary language.


I think, that this is incorrect behavior, especially for users, who don't usually enter data on non-primary language in hopes, that primary language value fallback will kick-in in all places and save the day.
patch ml_sorting_fix_520.patch (1,159) 2012-07-22 08:45
http://tracker.in-portal.org/file_download.php?file_id=1767&type=bug
patch ml_sorting_fix_513.patch (1,165) 2012-07-22 08:45
http://tracker.in-portal.org/file_download.php?file_id=1768&type=bug
Issue History
2012-07-25 05:29 alex Note Added: 0004822
2012-07-25 05:29 alex Status resolved => closed
2012-07-23 08:57 alex Note Added: 0004815
2012-07-23 08:57 alex Status reviewed and tested => resolved
2012-07-23 08:57 alex Fixed in Version => 5.2.0
2012-07-23 08:57 alex Resolution open => fixed
2012-07-23 08:57 alex Assigned To !COMMUNITY => alex
2012-07-23 08:57 alex Changeset attached 5.2.x r15466
2012-07-22 08:55 alex Note Added: 0004813
2012-07-22 08:55 alex Status needs testing => reviewed and tested
2012-07-22 08:49 alex Assigned To => !COMMUNITY
2012-07-22 08:49 alex Developer => alex
2012-07-22 08:49 alex Status active => needs testing
2012-07-22 08:47 alex Reference => https://groups.google.com/d/topic/in-portal-bugs/si_JGDz38do/discussion
2012-07-22 08:45 alex File Added: ml_sorting_fix_513.patch
2012-07-22 08:45 alex File Added: ml_sorting_fix_520.patch
2012-07-22 08:44 alex New Issue
2012-07-22 08:44 alex Change Log Message => Fixes problem with multilingual field not being sorted including fallback code
2012-07-22 08:44 alex Estimate Points => 1

Notes
(0004813)
alex   
2012-07-22 08:55   
Will test all together later.
(0004815)
alex   
2012-07-23 08:57   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0001366: Multilingual field sorting not working in some cases
(0004822)
alex   
2012-07-25 05:29   
Since 5.2.0 version was released.