Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-1125

Sort grids with multilingual fields with fallback support to translation from primary language



    • Type: Bug Report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.2.0-RC1
    • Fix Version/s: 5.2.0
    • Component/s: Data Management
    • Labels:


      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.


          Issue Links



              • Assignee:
                alex Alex
                alex Alex
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created: