CRM-9980 Group name should be translatable in multilingual installation

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.2.0
    • Component/s: None
    • Labels:
      None

      Description

      One good reason is that group name appears in unsubscribe page and should be in the language of the user visiting the page.

        Attachments

          Activity

          [CRM-9980] Group name should be translatable in multilingual installation
          Samuel Vanhove added a comment -

          Should work by doing 2 things :

          • add the column in CRM/Core/I18n/SchemaStructure.php
          • add a database upgrade in CRM/Upgrade/Incremental/sql/4.2.alpha1.mysql.tpl (use CRM/Upgrade/Incremental/sql/3.0.beta4.mysql.tpl as an example)
          Samuel Vanhove added a comment -

          Also, we need to change CRM/Contact/BAO/Group.php to use query with CRM_Core_DAO::executeQuery instead of using pear core functions (whereAdd, selectAdd, fetch) which doesn't allow to rewriteSql for multilingual.

          Samuel Vanhove added a comment -

          Seems to be more complicated than i thought. There is a pseudo constant allGroups based on group table. Also group can be used for permissions and mailing lists so maybe a few different places to look at.

          Samuel Vanhove added a comment -

          After all, there is not much to change and it seems to work well. I should write some tests for this.

          Samuel Vanhove added a comment -

          Commited to trunk

          Samuel Vanhove added a comment -

          I forgot to make upgrade patch

          Samuel Vanhove added a comment -

          I need to do some more test.
          I have this error when i activate multilingual :
          Database Error Code: Key column 'title_en_US' doesn't exist in table, 1072
          Additional Details:
          Array
          (
          [callback] => Array
          (
          [0] => CRM_Core_Error
          [1] => handle
          )

          [code] => -1
          [message] => DB Error: unknown error
          [mode] => 16
          [debug_info] => CREATE UNIQUE INDEX UI_title_en_US ON civicrm_group (title_en_US) [nativecode=1072 ** Key column 'title_en_US' doesn't exist in table]
          [type] => DB_Error
          [user_info] => CREATE UNIQUE INDEX UI_title_en_US ON civicrm_group (title_en_US) [nativecode=1072 ** Key column 'title_en_US' doesn't exist in table]
          [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="CREATE UNIQUE INDEX UI_title_en_US ON civicrm_group (title_en_US) [nativecode=1072 ** Key column 'title_en_US' doesn't exist in table]"]
          )

          Samuel Vanhove added a comment -

          Fixed. The bug was more generic, in some cases indexes where create before the column where added.

            People

            • Assignee:
              Samuel Vanhove
              Reporter:
              Samuel Vanhove

              Dates

              • Created:
                Updated:
                Resolved: