Doctrine 1
  1. Doctrine 1
  2. DC-373

Relating to Translation table (generated by Doctrine_I18n) doesn't work correctly after resetting connection

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.1, 1.2.2, 1.2.3
    • Fix Version/s: None
    • Component/s: Connection, I18n
    • Labels:
      None
    • Environment:
      PHP 5.2.11 (with Suhosin-Patch 0.9.7)
      PHP 5.3.6

      Description

      Relating to Translation table (generated by Doctrine_I18n) doesn't work correctly after resetting connection.

      First, I defined the following schema.yml::

       
        Example:
          actAs:
            I18n:
              fields: [title]
          columns:
              title: string(128)
      

      Next, I prepared the following fixture file::

       
        Example:
          Example_1:
            Translation:
              en:
                title: "Title"
              ja:
                title: "題名"
      

      Next, I run "build-all-reload" task. The table was created and data was loaded.

      And I write the following code::

       
        Doctrine_Core::loadModels('models');
        $example = Doctrine_Core::getTable('Example')->find(1);
        
        var_dump(
          $example->Translation['en']->title,
          $example->Translation['ja']->title
        );
        
        Doctrine_Manager::resetInstance();
        Doctrine_Manager::getInstance()->openConnection(DSN, 'doctrine');
        
        $example2 = Doctrine_Core::getTable('Example')->find(1);
        var_dump(
          $example2->Translation['en']->title,
          $example2->Translation['ja']->title
        );
      

      I try executing my code, but I got the following error::

        string(5) "Title"
        string(6) "題名"
        
        Doctrine_Connection_Mysql_Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.title' in 'field list' in /path/to/doctrine/Doctrine/Connection.php on line 1082
        
        Call Stack:
            0.0055      65352   1. {main}() /path/to/my/code/test.php:0
            0.2776    5873388   2. Doctrine_Table->find() /path/to/my/code/test.php:52
            0.2793    5881152   3. Doctrine_Query->fetchOne() /path/to/doctrine/Doctrine/Table.php:1611
            0.2793    5881296   4. Doctrine_Query_Abstract->execute() /path/to/doctrine/Doctrine/Query.php:281
            0.2793    5881892   5. Doctrine_Query_Abstract->_execute() /path/to/doctrine/Doctrine/Query/Abstract.php:1026
            0.3127    5890712   6. Doctrine_Connection->execute() /path/to/doctrine/Doctrine/Query/Abstract.php:976
            0.3164    5892632   7. Doctrine_Connection_Statement->execute() /path/to/doctrine/Doctrine/Connection.php:1006
            0.3181    5907408   8. Doctrine_Connection->rethrowException() /path/to/doctrine/Doctrine/Connection/Statement.php:269
      

        Activity

        Kousuke Ebihara created issue -
        Kousuke Ebihara made changes -
        Field Original Value New Value
        Description Relating to Translation table (generated by Doctrine_I18n) doesn't work correctly after resetting connection.

        First, I defined the following schema.yml::
          Example:
            actAs:
              I18n:
                fields: [title]
            columns:
                title: string(128)

        Next, I prepared the following fixture file::
          Example:
            Example_1:
              Translation:
                en:
                  title: "Title"
                ja:
                  title: "題名"

        Next, I run "build-all-reload" task. The table was created and data was loaded.

        And I write the following code::
          Doctrine_Core::loadModels('models');
          $example = Doctrine_Core::getTable('Example')->find(1);
          
          var_dump(
            $example->Translation['en']->title,
            $example->Translation['ja']->title
          );
          
          Doctrine_Manager::resetInstance();
          Doctrine_Manager::getInstance()->openConnection(DSN, 'doctrine');
          
          $example2 = Doctrine_Core::getTable('Example')->find(1);
          var_dump(
            $example2->Translation['en']->title,
            $example2->Translation['ja']->title
          );

        I try executing my code, but I got the following error::
          string(5) "Title"
          string(6) "題名"
          
          Doctrine_Connection_Mysql_Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.title' in 'field list' in /path/to/doctrine/Doctrine/Connection.php on line 1082
          
          Call Stack:
              0.0055 65352 1. {main}() /path/to/my/code/test.php:0
              0.2776 5873388 2. Doctrine_Table->find() /path/to/my/code/test.php:52
              0.2793 5881152 3. Doctrine_Query->fetchOne() /path/to/doctrine/Doctrine/Table.php:1611
              0.2793 5881296 4. Doctrine_Query_Abstract->execute() /path/to/doctrine/Doctrine/Query.php:281
              0.2793 5881892 5. Doctrine_Query_Abstract->_execute() /path/to/doctrine/Doctrine/Query/Abstract.php:1026
              0.3127 5890712 6. Doctrine_Connection->execute() /path/to/doctrine/Doctrine/Query/Abstract.php:976
              0.3164 5892632 7. Doctrine_Connection_Statement->execute() /path/to/doctrine/Doctrine/Connection.php:1006
              0.3181 5907408 8. Doctrine_Connection->rethrowException() /path/to/doctrine/Doctrine/Connection/Statement.php:269
        Relating to Translation table (generated by Doctrine_I18n) doesn't work correctly after resetting connection.

        First, I defined the following schema.yml::
        {quote}
          Example:
            actAs:
              I18n:
                fields: [title]
            columns:
                title: string(128)
        {/quote}

        Next, I prepared the following fixture file::
        {quote}
          Example:
            Example_1:
              Translation:
                en:
                  title: "Title"
                ja:
                  title: "題名"
        {/quote}

        Next, I run "build-all-reload" task. The table was created and data was loaded.

        And I write the following code::
        {quote}
          Doctrine_Core::loadModels('models');
          $example = Doctrine_Core::getTable('Example')->find(1);
          
          var_dump(
            $example->Translation['en']->title,
            $example->Translation['ja']->title
          );
          
          Doctrine_Manager::resetInstance();
          Doctrine_Manager::getInstance()->openConnection(DSN, 'doctrine');
          
          $example2 = Doctrine_Core::getTable('Example')->find(1);
          var_dump(
            $example2->Translation['en']->title,
            $example2->Translation['ja']->title
          );
        {/quote}

        I try executing my code, but I got the following error::
        {quote}
          string(5) "Title"
          string(6) "題名"
          
          Doctrine_Connection_Mysql_Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.title' in 'field list' in /path/to/doctrine/Doctrine/Connection.php on line 1082
          
          Call Stack:
              0.0055 65352 1. {main}() /path/to/my/code/test.php:0
              0.2776 5873388 2. Doctrine_Table->find() /path/to/my/code/test.php:52
              0.2793 5881152 3. Doctrine_Query->fetchOne() /path/to/doctrine/Doctrine/Table.php:1611
              0.2793 5881296 4. Doctrine_Query_Abstract->execute() /path/to/doctrine/Doctrine/Query.php:281
              0.2793 5881892 5. Doctrine_Query_Abstract->_execute() /path/to/doctrine/Doctrine/Query/Abstract.php:1026
              0.3127 5890712 6. Doctrine_Connection->execute() /path/to/doctrine/Doctrine/Query/Abstract.php:976
              0.3164 5892632 7. Doctrine_Connection_Statement->execute() /path/to/doctrine/Doctrine/Connection.php:1006
              0.3181 5907408 8. Doctrine_Connection->rethrowException() /path/to/doctrine/Doctrine/Connection/Statement.php:269
        {/quote}
        Kousuke Ebihara made changes -
        Description Relating to Translation table (generated by Doctrine_I18n) doesn't work correctly after resetting connection.

        First, I defined the following schema.yml::
        {quote}
          Example:
            actAs:
              I18n:
                fields: [title]
            columns:
                title: string(128)
        {/quote}

        Next, I prepared the following fixture file::
        {quote}
          Example:
            Example_1:
              Translation:
                en:
                  title: "Title"
                ja:
                  title: "題名"
        {/quote}

        Next, I run "build-all-reload" task. The table was created and data was loaded.

        And I write the following code::
        {quote}
          Doctrine_Core::loadModels('models');
          $example = Doctrine_Core::getTable('Example')->find(1);
          
          var_dump(
            $example->Translation['en']->title,
            $example->Translation['ja']->title
          );
          
          Doctrine_Manager::resetInstance();
          Doctrine_Manager::getInstance()->openConnection(DSN, 'doctrine');
          
          $example2 = Doctrine_Core::getTable('Example')->find(1);
          var_dump(
            $example2->Translation['en']->title,
            $example2->Translation['ja']->title
          );
        {/quote}

        I try executing my code, but I got the following error::
        {quote}
          string(5) "Title"
          string(6) "題名"
          
          Doctrine_Connection_Mysql_Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.title' in 'field list' in /path/to/doctrine/Doctrine/Connection.php on line 1082
          
          Call Stack:
              0.0055 65352 1. {main}() /path/to/my/code/test.php:0
              0.2776 5873388 2. Doctrine_Table->find() /path/to/my/code/test.php:52
              0.2793 5881152 3. Doctrine_Query->fetchOne() /path/to/doctrine/Doctrine/Table.php:1611
              0.2793 5881296 4. Doctrine_Query_Abstract->execute() /path/to/doctrine/Doctrine/Query.php:281
              0.2793 5881892 5. Doctrine_Query_Abstract->_execute() /path/to/doctrine/Doctrine/Query/Abstract.php:1026
              0.3127 5890712 6. Doctrine_Connection->execute() /path/to/doctrine/Doctrine/Query/Abstract.php:976
              0.3164 5892632 7. Doctrine_Connection_Statement->execute() /path/to/doctrine/Doctrine/Connection.php:1006
              0.3181 5907408 8. Doctrine_Connection->rethrowException() /path/to/doctrine/Doctrine/Connection/Statement.php:269
        {/quote}
        Relating to Translation table (generated by Doctrine_I18n) doesn't work correctly after resetting connection.

        First, I defined the following schema.yml::
        {quote}
          Example:
            actAs:
              I18n:
                fields: [title]
            columns:
                title: string(128)
        {quote}

        Next, I prepared the following fixture file::
        {quote}
          Example:
            Example_1:
              Translation:
                en:
                  title: "Title"
                ja:
                  title: "題名"
        {quote}

        Next, I run "build-all-reload" task. The table was created and data was loaded.

        And I write the following code::
        {quote}
          Doctrine_Core::loadModels('models');
          $example = Doctrine_Core::getTable('Example')->find(1);
          
          var_dump(
            $example->Translation['en']->title,
            $example->Translation['ja']->title
          );
          
          Doctrine_Manager::resetInstance();
          Doctrine_Manager::getInstance()->openConnection(DSN, 'doctrine');
          
          $example2 = Doctrine_Core::getTable('Example')->find(1);
          var_dump(
            $example2->Translation['en']->title,
            $example2->Translation['ja']->title
          );
        {quote}

        I try executing my code, but I got the following error::
        {quote}
          string(5) "Title"
          string(6) "題名"
          
          Doctrine_Connection_Mysql_Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.title' in 'field list' in /path/to/doctrine/Doctrine/Connection.php on line 1082
          
          Call Stack:
              0.0055 65352 1. {main}() /path/to/my/code/test.php:0
              0.2776 5873388 2. Doctrine_Table->find() /path/to/my/code/test.php:52
              0.2793 5881152 3. Doctrine_Query->fetchOne() /path/to/doctrine/Doctrine/Table.php:1611
              0.2793 5881296 4. Doctrine_Query_Abstract->execute() /path/to/doctrine/Doctrine/Query.php:281
              0.2793 5881892 5. Doctrine_Query_Abstract->_execute() /path/to/doctrine/Doctrine/Query/Abstract.php:1026
              0.3127 5890712 6. Doctrine_Connection->execute() /path/to/doctrine/Doctrine/Query/Abstract.php:976
              0.3164 5892632 7. Doctrine_Connection_Statement->execute() /path/to/doctrine/Doctrine/Connection.php:1006
              0.3181 5907408 8. Doctrine_Connection->rethrowException() /path/to/doctrine/Doctrine/Connection/Statement.php:269
        {quote}
        Kousuke Ebihara made changes -
        Description Relating to Translation table (generated by Doctrine_I18n) doesn't work correctly after resetting connection.

        First, I defined the following schema.yml::
        {quote}
          Example:
            actAs:
              I18n:
                fields: [title]
            columns:
                title: string(128)
        {quote}

        Next, I prepared the following fixture file::
        {quote}
          Example:
            Example_1:
              Translation:
                en:
                  title: "Title"
                ja:
                  title: "題名"
        {quote}

        Next, I run "build-all-reload" task. The table was created and data was loaded.

        And I write the following code::
        {quote}
          Doctrine_Core::loadModels('models');
          $example = Doctrine_Core::getTable('Example')->find(1);
          
          var_dump(
            $example->Translation['en']->title,
            $example->Translation['ja']->title
          );
          
          Doctrine_Manager::resetInstance();
          Doctrine_Manager::getInstance()->openConnection(DSN, 'doctrine');
          
          $example2 = Doctrine_Core::getTable('Example')->find(1);
          var_dump(
            $example2->Translation['en']->title,
            $example2->Translation['ja']->title
          );
        {quote}

        I try executing my code, but I got the following error::
        {quote}
          string(5) "Title"
          string(6) "題名"
          
          Doctrine_Connection_Mysql_Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.title' in 'field list' in /path/to/doctrine/Doctrine/Connection.php on line 1082
          
          Call Stack:
              0.0055 65352 1. {main}() /path/to/my/code/test.php:0
              0.2776 5873388 2. Doctrine_Table->find() /path/to/my/code/test.php:52
              0.2793 5881152 3. Doctrine_Query->fetchOne() /path/to/doctrine/Doctrine/Table.php:1611
              0.2793 5881296 4. Doctrine_Query_Abstract->execute() /path/to/doctrine/Doctrine/Query.php:281
              0.2793 5881892 5. Doctrine_Query_Abstract->_execute() /path/to/doctrine/Doctrine/Query/Abstract.php:1026
              0.3127 5890712 6. Doctrine_Connection->execute() /path/to/doctrine/Doctrine/Query/Abstract.php:976
              0.3164 5892632 7. Doctrine_Connection_Statement->execute() /path/to/doctrine/Doctrine/Connection.php:1006
              0.3181 5907408 8. Doctrine_Connection->rethrowException() /path/to/doctrine/Doctrine/Connection/Statement.php:269
        {quote}
        Relating to Translation table (generated by Doctrine_I18n) doesn't work correctly after resetting connection.

        First, I defined the following schema.yml::
        {code:none}
          Example:
            actAs:
              I18n:
                fields: [title]
            columns:
                title: string(128)
        {code}

        Next, I prepared the following fixture file::
        {code:none}
          Example:
            Example_1:
              Translation:
                en:
                  title: "Title"
                ja:
                  title: "題名"
        {code}

        Next, I run "build-all-reload" task. The table was created and data was loaded.

        And I write the following code::
        {code:java}
          Doctrine_Core::loadModels('models');
          $example = Doctrine_Core::getTable('Example')->find(1);
          
          var_dump(
            $example->Translation['en']->title,
            $example->Translation['ja']->title
          );
          
          Doctrine_Manager::resetInstance();
          Doctrine_Manager::getInstance()->openConnection(DSN, 'doctrine');
          
          $example2 = Doctrine_Core::getTable('Example')->find(1);
          var_dump(
            $example2->Translation['en']->title,
            $example2->Translation['ja']->title
          );
        {code}

        I try executing my code, but I got the following error::
        {code:none}
          string(5) "Title"
          string(6) "題名"
          
          Doctrine_Connection_Mysql_Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.title' in 'field list' in /path/to/doctrine/Doctrine/Connection.php on line 1082
          
          Call Stack:
              0.0055 65352 1. {main}() /path/to/my/code/test.php:0
              0.2776 5873388 2. Doctrine_Table->find() /path/to/my/code/test.php:52
              0.2793 5881152 3. Doctrine_Query->fetchOne() /path/to/doctrine/Doctrine/Table.php:1611
              0.2793 5881296 4. Doctrine_Query_Abstract->execute() /path/to/doctrine/Doctrine/Query.php:281
              0.2793 5881892 5. Doctrine_Query_Abstract->_execute() /path/to/doctrine/Doctrine/Query/Abstract.php:1026
              0.3127 5890712 6. Doctrine_Connection->execute() /path/to/doctrine/Doctrine/Query/Abstract.php:976
              0.3164 5892632 7. Doctrine_Connection_Statement->execute() /path/to/doctrine/Doctrine/Connection.php:1006
              0.3181 5907408 8. Doctrine_Connection->rethrowException() /path/to/doctrine/Doctrine/Connection/Statement.php:269
        {code}
        Joe Siponen made changes -
        Affects Version/s 1.2.2 [ 10047 ]
        Joe Siponen made changes -
        Attachment DC373TestCase.php [ 11015 ]
        Joe Siponen made changes -
        Affects Version/s 1.2.3 [ 10051 ]
        Affects Version/s 1.2.4 [ 10063 ]
        Joe Siponen made changes -
        Environment PHP 5.2.11 (with Suhosin-Patch 0.9.7) PHP 5.2.11 (with Suhosin-Patch 0.9.7)
        PHP 5.3.6
        Guilherme Blanco made changes -
        Affects Version/s 1.2.4 [ 10063 ]

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Kousuke Ebihara
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: