Doctrine 1
  1. Doctrine 1
  2. DC-425

I18n - Can't create lang column as varchar(5)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.2.2
    • Component/s: Behaviors, I18n
    • Labels:
      None

      Description

      I need to override the LANG column size on i18n tables, so I can use "pt_BR" language. I'd like the LANG column to be varchar(5) and not char(5) as it happens if I modify the field length to 5.

      I've also tried to set the "fixed" option as false, but I noticed that the I18n generator overrides this option (I18n.php - line 98).

      The only workaround I could find was setting the length option as null and the type as varchar(5), but at least for me, it doesn't seem to be the most correct way to define it.

      I'd suggest modifying the I18n table definition generator to not override this option.

      I've attached a patch with the proposed fix.

      1. I18n.patch
        0.6 kB
        Carlos Gonser

        Activity

        Hide
        Gilmar Pupo added a comment -

        I confirm the problem by using en_US.
        I ended up using a modified trunk of lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/I18n.php

        Show
        Gilmar Pupo added a comment - I confirm the problem by using en_US. I ended up using a modified trunk of lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/I18n.php
        Hide
        Gilmar Pupo added a comment -

        SImple fix:

        — a/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/I18n.php
        +++ b/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/I18n.php
        @@ -42,7 +42,7 @@ class Doctrine_I18n extends Doctrine_Record_Generator
        'children' => array(),
        'i18nField' => 'lang',
        'type' => 'string',

        • 'length' => 2,
          + 'length' => 5,
          'options' => array(),
          'cascadeDelete' => true,
          'appLevelDelete'=> false
          @@ -131,4 +131,4 @@ class Doctrine_I18n extends Doctrine_Record_Generator
          }
          }
          }
          -}
        Show
        Gilmar Pupo added a comment - SImple fix: — a/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/I18n.php +++ b/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/I18n.php @@ -42,7 +42,7 @@ class Doctrine_I18n extends Doctrine_Record_Generator 'children' => array(), 'i18nField' => 'lang', 'type' => 'string', 'length' => 2, + 'length' => 5, 'options' => array(), 'cascadeDelete' => true, 'appLevelDelete'=> false @@ -131,4 +131,4 @@ class Doctrine_I18n extends Doctrine_Record_Generator } } } -}

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Carlos Gonser
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: