Skip to content

Conversation

VincentChalnot
Copy link
Contributor

When provided with both a fromProperty and toProperty in a link, the wrong class metadata was used to find the type of the identifier parameters (line 123).

Q A
Branch? 3.x
Tickets No
License MIT

$doctrineClassMetadata was used for both the resource class and the fromClass which was confusing, I renamed the latter to fromClassMetadata in order to clarify things up.

@VincentChalnot VincentChalnot changed the title Fixing issue in ORM/LinkHandlerTrait. Fixing issue in ORM/LinkHandlerTrait : Wrong class metadata Mar 30, 2023
@soyuka
Copy link
Member

soyuka commented Mar 30, 2023

Thanks! May you commit following our commit guidelines?

fix(doctrine): use fromClass metadata for each link 
When provided with both a fromProperty and toProperty in a link, the wrong class metadata was used to find the type of the identifier parameters (line 123). $doctrineClassMetadata was used for both the resource class and the fromClass which was confusing, I renamed the latter to fromClassMetadata in order to clarify things up.
@VincentChalnot
Copy link
Contributor Author

Thanks! May you commit following our commit guidelines?

fix(doctrine): use fromClass metadata for each link 

Done

@soyuka
Copy link
Member

soyuka commented Apr 4, 2023

Could you add a test within the ItemProviderTest?

@soyuka soyuka merged commit 60082d7 into api-platform:3.1 Apr 21, 2023
@VincentChalnot
Copy link
Contributor Author

Could you add a test within the ItemProviderTest?

Thank for merging, sorry I didn't had time to write some tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants