Doctrine 1
  1. Doctrine 1
  2. DC-316

Model classes aren't loaded anymore when migrating to 1.2

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Mac os, leopard 10.5. I use conservative model loading and autoload table classes.

      Description

      When migrating from doctrine 1.1.0 to 1.2 it fails to load the model classes anymore. It complains it cannot find the model class 'Building' when doing a Doctrine::getTable('Building')->findAll(). See attached backtrace. After hours of digging in the code and countless debug statements I found out that the automatic loading of the model classes is removed (for some good reason?) from the doctrine autoloader(). This will off course give exceptions for people depending on this mechanism!

      It seems that the solution is to add another spl_autoload_register(array('Doctrine','modelsAutoload')); to the bootstrapper (apart from the normal spl_autoload_register(array('Doctrine','autoload'));

      But the strangest thing is: I could not find any information about this, although this is (I would say) VERY critical information for people depending on auto model class loading and would like to keep it working! So I would suggest to put this critical information into the ('migration' or 'what is new') documentation of 1.2 because I could not find it. Yes, there is something about PEAR like model loading, but that is not what I want, I would like to keep my app still working after migrating to 1.2.

      1. ff.txt
        1 kB
        aiso haikens

        Activity

        Hide
        Jonathan H. Wage added a comment -

        I added some information about this to the upgrade file. Thanks for reporting it and sorry about the missing information.

        Show
        Jonathan H. Wage added a comment - I added some information about this to the upgrade file. Thanks for reporting it and sorry about the missing information.
        Hide
        Alfredo Beaumont added a comment -

        I had the same problem, but I was not migrating but trying doctrine for the first time. I suggest you to modify the "Doctrine ORM for PHP" document for 1.2 since it doesn't talk about this issue and it's rather frustrating to see how the generate.php doesn't work at all for no aparent reason (no error, no warning). I also had to dig in the code for some hours, which is not something that should be expected on a first aproach... and may give a bad impression to many newcomers.

        Show
        Alfredo Beaumont added a comment - I had the same problem, but I was not migrating but trying doctrine for the first time. I suggest you to modify the "Doctrine ORM for PHP" document for 1.2 since it doesn't talk about this issue and it's rather frustrating to see how the generate.php doesn't work at all for no aparent reason (no error, no warning). I also had to dig in the code for some hours, which is not something that should be expected on a first aproach... and may give a bad impression to many newcomers.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: