mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
2.6.4. breaks queries using objects as parameters #6304
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 @kdambekalns on GitHub (Sep 23, 2019).
Originally assigned to: @Ocramius on GitHub.
BC Break Report
Summary
Upgrading from 2.6.3 to 2.6.4 triggers an error related to obejct parameters in queries.
Previous behavior
It worked ;)
Current behavior
How to reproduce
Update
doctrine/ormfrom 2.6.3 to 2.6.4 and see it fail. The code is complex, but the main part involved should be:My wild guess would that the fix #7527 in PR #7528 might cause it.
@Ocramius commented on GitHub (Sep 23, 2019):
This should indeed not be converted to identifiers, since you're binding a string array, yet declared
$workspaces, which I assume is aWorkspace[]?@kdambekalns commented on GitHub (Sep 23, 2019):
Might be true… I am quite sure we did add that parameter hint on purpose, and it worked before. So… I'll try to fix that.
@Ocramius commented on GitHub (Sep 23, 2019):
Can you maybe come up with a test case verifying your use-case (that is green on
2.6.3, and red on2.6.4)?@kdambekalns commented on GitHub (Sep 23, 2019):
I'll try the test-case, but removing the wrong parameter type hint or actually passing an array of strings solves the issue for our code. So I guess it's really a "side-effect we used so far" that has been removed. Too bad I cannot remeber what we actually fixed back then by adding it…
@lcobucci commented on GitHub (Sep 23, 2019):
@kdambekalns should we close this issue, then?
@kdambekalns commented on GitHub (Sep 23, 2019):
Feel free, if I come around to creating a valid test case, I'll let you know. Thanks!
@snebes commented on GitHub (Sep 25, 2019):
I've outlined this issue in more detail in #7832. In v2.6.3, the $type was verified before being used, where in v2.6.4, the $type is blindly accepted without type-checking.
@Ocramius commented on GitHub (Sep 25, 2019):
This is the correct/expected behavior
@szambonurek commented on GitHub (Oct 17, 2019):
2.6.4 introduced bc breaking change. This code worked in 2.6.3 and befire. Now it fails
This change is causig this:
\Doctrine\ORM\Query::resolveParameterValue::435
@Ocramius commented on GitHub (Oct 17, 2019):
@szambonurek can you write a test case? I cannot see parameter binding in your example (specifically, query and parameter format)
$idsis supposed to be anint[]there: what do you have instead?