Doctrine 1
  1. Doctrine 1
  2. DC-895

[I18n] Defining languages with locality (eg. en_GB) breaks functionality with SQL Integrity error - fix included

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Invalid
    • Affects Version/s: 1.2.0, 1.2.1, 1.2.2, 1.2.3
    • Fix Version/s: 1.2.0, 1.2.1, 1.2.2, 1.2.3
    • Component/s: I18n
    • Labels:
      None
    • Environment:
      all

      Description

      When defining languages as language_COUNTRY codes (supported by symfony by default), the functionality to work with I18n records breaks, resulting in "SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry" errors.

      The reason is very simple: Doctrine's I18n language column is defined as a CHAR(2), thus shortening eg. "en_GB" value to "en", thus causing the above SQL error when a "en" translation for a record already exists.

      The solution is even simpler: change the column's length to 7 in the Doctrine_I18n class's options: I've tested this and all runs great: the correct SQL is being generated, the models behave correct, ...

        Activity

        Hide
        Erik Van Kelst added a comment -

        Length of the i18n column is configurable...

        Show
        Erik Van Kelst added a comment - Length of the i18n column is configurable...

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Erik Van Kelst
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: