-
-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Php notice for query builder / dbref query preparation: Undefined index: $db #1635
Comments
@Nilz11 thanks for submitting the issue! One question though, what is the value of |
What about ClassMetadataInfo::REFERENCE_STORE_AS_DB_REF? |
Sorry, not sure what about that? |
storeAs can be one of this three values. Why do you say that the |
I'm sorry, you are correct, for some reason I thought about generating DBRef object, not preparing it. |
Can add a test when I have time later |
* 1.1.x: Relax version constraint for doctrine/instantiator Fixes dbref doctrine#1635
Closing since #1636 was merged. |
If no target document is set and storeAs is set to "dbRef" the query builder will throw a PHP notice:
Undefined index: $db
when doing an equals with something like this, where $user is a document
->field('user')->equals($user)
Issue is that there is a bug in document persister
prepareDbRefElement
method:if ($mapping['storeAs'] === ClassMetadataInfo::REFERENCE_STORE_AS_ID) {
should be
if ($mapping['storeAs'] !== ClassMetadataInfo::REFERENCE_STORE_AS_DB_REF_WITH_DB) {
The text was updated successfully, but these errors were encountered: