You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The entities must be provided to the config 'entities' field in hierarchical order. I don't think this is specified anywhere, and it results in very odd behavior.
Stack trace
ValidationError: Entity 'Parent' does not have property 'rel'
51 |
52 | static invalidPropertyName(entityName: string, invalid: string): ValidationError {
> 53 | return new ValidationError(`Entity '${entityName}' does not have property '${invalid}'`);
| ^
54 | }
55 |
56 | static invalidType(type: Constructor<any>, value: any, mode: string): ValidationError {
at Function.invalidPropertyName (packages/core/src/errors.ts:53:12)
at EntityLoader.populate (packages/core/src/entity/EntityLoader.ts:43:29)
at SqlEntityManager.find (packages/core/src/EntityManager.ts:111:29)
at Object.<anonymous> (tests/issues/GH845.test.ts:83:21)
To Reproduce
Edit GH845.test.ts and change the entities array to: entities: [Base, Relation1, Child1Specific, Child1, Child2, Parent],
Expected behavior
I expect that the order of this list doesn't matter. I can fully understand why it does, and there is an obvious workaround. I think this restriction should, at the least, be documented.
The text was updated successfully, but these errors were encountered:
Weird, the order should not matter in general (there are some cases when it does because of circular dependencies, but your error runtime one, so discovery finished).
The reason we discovered this was because the properties we expected to be in the table were not, based on our STI domain classes. This resulted in the MySQL schema missing many of the fields.
Describe the bug
The entities must be provided to the config 'entities' field in hierarchical order. I don't think this is specified anywhere, and it results in very odd behavior.
Stack trace
ValidationError: Entity 'Parent' does not have property 'rel'
To Reproduce
Expected behavior
I expect that the order of this list doesn't matter. I can fully understand why it does, and there is an obvious workaround. I think this restriction should, at the least, be documented.
The text was updated successfully, but these errors were encountered: