mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
BasicEntityPersister confuses association types with PDO datatypes #5884
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mariusklocke on GitHub (Feb 13, 2018).
Originally assigned to: @lcobucci on GitHub.
Hey folks,
i think i found a bug when combining one-to-one associations with association-key identifiers. My application deals with soccer leagues and the issue should become visible with the following 3 related entities:
The issue arises when changes to
RankingPositionneed to be persisted. Updating this entity does not work, because the resulting query sends a wrong parameter type for theseason_idDoctrine determines
1as parameter type (corresponds toPDO::PARAM_INT) for theseason_id, but it should bestring.I did a little debugging and i think i found an implementation flaw in
Doctrine\ORM\Persisters\Entity\BasicEntityPersister::updateTable(). The method tries to determine the parameter type for each identifier column, by using thetypefield in the target entitiesassociationMappings. This fields value does NOT represent one of thePDO::PARAM_*constants. I think this field reflects the association type and the value1here represents the constantDoctrine\ORM\Mapping\ClassMetadataInfo::ONE_TO_ONE.Can anybody closer to the project confirm my assumptions?
You can find my application here on Github: https://github.com/mariusklocke/liga-manager-api
@Ocramius commented on GitHub (Feb 14, 2018):
@mariusklocke can this be reproduced in isolation (see https://github.com/doctrine/doctrine2/tree/master/tests/Doctrine/Tests/ORM/Functional/Ticket for examples)? Is this affecting latest ORM?
@mariusklocke commented on GitHub (Feb 14, 2018):
I'll try to provide a Testcase. By "latest" you mean master branch?
It's definitely happing on 2.6.0
Are there any conventions i should follow for naming my branch?
@Ocramius commented on GitHub (Feb 14, 2018):
@mariusklocke no convention - feel free to pick anything. We'll adjust the patch anyway once we have a clue of what is going on in an isolated scenario. My suggestion is to name the test DDC7062Test.
@mariusklocke commented on GitHub (Feb 20, 2018):
@Ocramius Hey, i created a PR with a failing test, but i am unsure whether i got the branches right. I created my branch from 2.6 branch, but the contribution guidelines say all PRs have to go to master? That seems weird to me, because i thought bugfixes for 2.6 should go into 2.6 branch? Can you help me out here?
@Ocramius commented on GitHub (Feb 20, 2018):
@mariusklocke send it against
2.6for now - we'll figure it out :) You can just edit the open pull request@Ocramius commented on GitHub (Feb 27, 2018):
Handled in #7082