Doctrine 1
  1. Doctrine 1
  2. DC-1029

Extensions of Doctrine_Template_I18n incompatible with Doctrine_Import

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Trivial Trivial
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Windows 7, XAMPP 1.7.4 with APC and Curl, symfony 1.4.8

      Description

      Extending Doctrine_Template_I18n class make Doctrine_Import on YAML data with translation fails...

      Why ? Just because of this line :

      Doctrine_Import.php, line 135 :
      if ($table->hasRelation($key) && is_array($value) && ! $table->hasTemplate('Doctrine_Template_I18n')) {

      In fact, having a template named "Doctrine_Template_I18n" is not strong enough to be sure that the current object has an I18n behavior.

      The bug is very simple to reproduce :

      1. Get a classic I18n fixtures like :

      Article:
      Translation:
      en:
      title: Lorem Ipsum

      2. Then make a simple extension of the I18n template (do not do anything else but extends the Doctrine_Template_I18n class) :

      class My_Doctrine_Template_I18n extends Doctrine_Template_I18n {}

      3. Load the extension, assign it to your model and try to import your fixtures again. It will not work anymore.

      Thanks

        Activity

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Pierrot Evrard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: