Doctrine 1
  1. Doctrine 1
  2. DC-126

Doctrine_Migration_Diff breaks on inherited class

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0-ALPHA1, 1.2.0-ALPHA2
    • Fix Version/s: 1.2.1
    • Component/s: Migrations
    • Labels:
      None
    • Environment:
      php 5.3 / symfony 1.3

      Description

      This ticket is a duplicate of this one http://trac.symfony-project.org/ticket/7272 but it's more a Doctrine bug than a symfony one.

      When trying to make a diff on schema with inheritance, the task breaks when trying to load a model inherited from an other one. I think this is because the inherited model might be loaded before his ancestor.

        Activity

        Hide
        Alex Gilbert added a comment -

        I am having this problem as well.

        
        

        >> doctrine generating migration diff
        >> file+ /private/var/folders/uO/uOcfxzTRGA8G6XQvExbGF++++TI/Tmp/doctrine_schema_87129.yml

        Fatal error: Class 'ToPrfxpkContextCMSSlot' not found in /private/var/folders/uO/uOcfxzTRGA8G6XQvExbGF++++TI/Tmp/toprfx_doctrine_tmp_dirs/ToPrfxpkContextCMSButtonSlot.php on line 14

        {/code}

        The most recent activity on this issue seems to be in the symfony Trac, where Jon said work would be continued in here, but this ticket is also closed. I don't know Jira as well, is there a way to re-open this ticket? Is there an active clone of it somewhere?

        Thanks.

        Show
        Alex Gilbert added a comment - I am having this problem as well. >> doctrine generating migration diff >> file+ /private/var/folders/uO/uOcfxzTRGA8G6XQvExbGF++++TI/ Tmp /doctrine_schema_87129.yml Fatal error: Class 'ToPrfxpkContextCMSSlot' not found in /private/var/folders/uO/uOcfxzTRGA8G6XQvExbGF++++TI/ Tmp /toprfx_doctrine_tmp_dirs/ToPrfxpkContextCMSButtonSlot.php on line 14 {/code} The most recent activity on this issue seems to be in the symfony Trac, where Jon said work would be continued in here, but this ticket is also closed. I don't know Jira as well, is there a way to re-open this ticket? Is there an active clone of it somewhere? Thanks.
        Hide
        Tom Boutell added a comment -

        Reproducible test case:

        [Remove your toprfx_doctrine_tmp_dirs etc. from your tmp folder, leftover classes from earlier crashes can cause unrelated errors, see separate ticket]

        svn co http://svn.symfony-project.com/plugins/pkContextCMSPlugin/sandbox/branches/1.3 cmstest13
        cd cmstest13
        Create config/doctrine/schema.yml and add a trivial table so another bug won't be triggered (I opened a separate ticket on that):

        Frog:
        columns:
        name: string

        ./symfony doctrine:build --all
        ./symfony doctrine:generate-migrations-diff

        Fatal error: Class 'ToPrfxpkContextCMSSlot' not found in /private/var/folders/3H/3Hu3TTyjFtuvtN3D5tDUxU+++TI/Tmp/toprfx_doctrine_tmp_dirs/ToPrfxpkContextCMSButtonSlot.php on line 15

        Note that pkContextCMSButtonSlot inherits from pkContextCMSSlot using Doctrine column aggregation inheritance. It appears that the autoloader just isn't trying to resolve inheritance relationships between classes in the toprfx_doctrine_tmp_dirs folder.

        Show
        Tom Boutell added a comment - Reproducible test case: [Remove your toprfx_doctrine_tmp_dirs etc. from your tmp folder, leftover classes from earlier crashes can cause unrelated errors, see separate ticket] svn co http://svn.symfony-project.com/plugins/pkContextCMSPlugin/sandbox/branches/1.3 cmstest13 cd cmstest13 Create config/doctrine/schema.yml and add a trivial table so another bug won't be triggered (I opened a separate ticket on that): Frog: columns: name: string ./symfony doctrine:build --all ./symfony doctrine:generate-migrations-diff Fatal error: Class 'ToPrfxpkContextCMSSlot' not found in /private/var/folders/3H/3Hu3TTyjFtuvtN3D5tDUxU+++TI/ Tmp /toprfx_doctrine_tmp_dirs/ToPrfxpkContextCMSButtonSlot.php on line 15 Note that pkContextCMSButtonSlot inherits from pkContextCMSSlot using Doctrine column aggregation inheritance. It appears that the autoloader just isn't trying to resolve inheritance relationships between classes in the toprfx_doctrine_tmp_dirs folder.
        Hide
        Robert Gruendler added a comment -

        i've created a patch which fixes the issue, it's attached to the corresponding symfony ticket:

        http://trac.symfony-project.org/ticket/7272

        It modifies the core autoloading code and i'm not really familiar with the doctrine autoloading code, so please let me know if this
        approach can be approved.

        Show
        Robert Gruendler added a comment - i've created a patch which fixes the issue, it's attached to the corresponding symfony ticket: http://trac.symfony-project.org/ticket/7272 It modifies the core autoloading code and i'm not really familiar with the doctrine autoloading code, so please let me know if this approach can be approved.
        Hide
        Jonathan H. Wage added a comment -

        Hi, the patch cannot be committed. It is a blatant hack and cannot be applied. I have a solution I will commit soon though.

        Show
        Jonathan H. Wage added a comment - Hi, the patch cannot be committed. It is a blatant hack and cannot be applied. I have a solution I will commit soon though.
        Hide
        Jonathan H. Wage added a comment -

        This should be fixed now: http://trac.symfony-project.org/changeset/28871

        Thanks, Jon

        Show
        Jonathan H. Wage added a comment - This should be fixed now: http://trac.symfony-project.org/changeset/28871 Thanks, Jon

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Marc Weistroff
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: