Details
Description
Using the attached schema.yml works fine with Symfony-1.2 and Doctrine-1.0. It even works when I have tested it with Symfony-1.2 and Doctrine-1.1.
However, when using Symfony-1.3 and Doctrine-1.2 the following happens:
> php symfony doctrine:build-all-reload >> doctrine Dropping "doctrine" database >> doctrine Creating "dev" environment "doctrine" database >> doctrine generating model classes >> file+ C:\Users\XXXXXXXXXXXXXXXX\AppDa...\Temp/doctrine_schema_30398.yml >> tokens C:/web/sf_sandbox-1.3/lib/model/doctrine/base/BaseBar.class.php >> tokens C:/web/sf_sandbox-1.3/lib/model/doctrine/base/BaseFoo.class.php >> tokens C:/web/sf_sandbox-1.3/lib/model...e/base/BaseJoinFooBar.class.php >> autoload Resetting application autoloaders >> file- C:/web/sf_sandbox-1.3/cache/fro.../config/config_autoload.yml.php >> doctrine generating form classes >> tokens C:/web/sf_sandbox-1.3/lib/form/BaseForm.class.php >> tokens C:/web/sf_sandbox-1.3/lib/form/doctrine/BarForm.class.php >> tokens C:/web/sf_sandbox-1.3/lib/form/...rine/base/BaseBarForm.class.php >> tokens C:/web/sf_sandbox-1.3/lib/form/...rine/base/BaseFooForm.class.php >> tokens C:/web/sf_sandbox-1.3/lib/form/...se/BaseJoinFooBarForm.class.php >> tokens C:/web/sf_sandbox-1.3/lib/form/...rine/BaseFormDoctrine.class.php >> tokens C:/web/sf_sandbox-1.3/lib/form/doctrine/FooForm.class.php >> tokens C:/web/sf_sandbox-1.3/lib/form/doctrine/JoinFooBarForm.class.php >> autoload Resetting application autoloaders >> file- C:/web/sf_sandbox-1.3/cache/fro.../config/config_autoload.yml.php >> doctrine generating filter form classes >> tokens C:/web/sf_sandbox-1.3/lib/filte...octrine/BarFormFilter.class.php >> tokens C:/web/sf_sandbox-1.3/lib/filte...ase/BaseBarFormFilter.class.php >> tokens C:/web/sf_sandbox-1.3/lib/filte...ase/BaseFooFormFilter.class.php >> tokens C:/web/sf_sandbox-1.3/lib/filte...eJoinFooBarFormFilter.class.php >> tokens C:/web/sf_sandbox-1.3/lib/filte...aseFormFilterDoctrine.class.php >> tokens C:/web/sf_sandbox-1.3/lib/filte...octrine/FooFormFilter.class.php >> tokens C:/web/sf_sandbox-1.3/lib/filte.../JoinFooBarFormFilter.class.php >> autoload Resetting application autoloaders >> file- C:/web/sf_sandbox-1.3/cache/fro.../config/config_autoload.yml.php >> doctrine generating sql for models >> doctrine Generated SQL successfully for models >> doctrine created tables successfully >> doctrine Loading data fixtures from "C:\web\sf_sandbox-1.3\data/fixtures" Couldn't find class FooBar
The attached schema.yml looks like this:
# /config/doctrine/schema.yml
Foo:
columns:
id:
type: integer(8)
primary: true
autoincrement: true
foo_field: string(100)
relations:
Bars:
class: Bar
refClass: JoinFooBar
local: foo_id
foreign: bar_id
Bar:
columns:
id:
type: integer(8)
primary: true
autoincrement: true
bar_field: string(30)
JoinFooBar:
columns:
foo_id:
type: integer(8)
primary: true
bar_id:
type: integer(8)
primary: true
As you can see, there is not meant to be any class called FooBar (the reference class for the many-to-many join is called JoinFooBar) so where is the name "FooBar" being picked up from and why is the code complaining that it cannot be found?
The fixture file is empty so there shouldn't be anything causing problems there.
This bug is making it impossible to upgrade our existing projects to Symfony-1.3 + Doctrine-1.2 so I'd be most grateful if you could look into this.
If the schema is changed from:
...
bar_field: string(30)
JoinFooBar:
columns:
...
To:
...
bar_field: string(30)
FooBar:
columns:
...
it seems to work, (that error disappears - even though the refClass is still set to *Join*FooBar) but we cannot easily justify changing all the classnames of all our Join tables in the projects we want to upgrade!
I hope you can see some simple solution to this and I'm happy to answer any questions you have.
(To reproduce this bug use the symfony sandbox, create a database and then use the attached schema.yml file.)
C
Activity
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Fixed [ 1 ] |
| Resolution | Fixed [ 1 ] | |
| Status | Resolved [ 5 ] | Reopened [ 4 ] |
| Summary | refClass setting seems to be ignored? | refClass setting seems to be ignored? (UPDATE: includes proposed solutions) |
| Component/s | Query [ 10037 ] |
| Summary | refClass setting seems to be ignored? (UPDATE: includes proposed solutions) | Error with tokenizer for JOINs (comments include proposed solutions) |
| Attachment | jira-ticket-dc366.patch [ 10407 ] |
| Status | Reopened [ 4 ] | Closed [ 6 ] |
| Fix Version/s | 1.2.2 [ 10047 ] | |
| Resolution | Fixed [ 1 ] |
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DC-366, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
As reported here:
http://forum.symfony-project.org/index.php/t/24441/
It seems that the problem is with the doctrine:build-all-reload in symfony and not anything deeper.
As such, I think it would make sense to disactivate that task in symfony (rather than marking it as deprecated) since it is broken and a note in it directing people to use the new tasks would be far more useful.
C