When using mongodb field storage the field_has_data() seems to always return true, as the logic only selects the on the collection and doesn't determine if the field actually exists in the index.
Patch to follow.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | field_has_data.1547198-4.patch | 1.26 KB | camidoo |
| #1 | field_has_data.1547198-1.patch | 1.07 KB | camidoo |
Comments
Comment #1
camidoo commentedCurrently when determining if the EFQ in question is a 'has_data' query, the resulting collection is queried without checking the existence of the field in question, which results in a result that is always TRUE.
changing this to check for the existence of the field (meaning there is data present) fixes the issue:
Comment #2
misc commentedGreat, I started to work on a patch for this problem, but got problem with my solution, this seems more straightforward - it will check it later today.
Comment #3
camidoo commentedAdditionally it is looping through bundles and omitting that information in the query as well, should the bundle / type be included as well?
Comment #4
camidoo commentedPatch for #3
Comment #5
misc commented#3: Yes I think that bundle/type should be included.
Booth patches reviewed and committed to latest dev.
Thanks for you contribution, field_has_data has been a problem for a while now.
Comment #6
misc commented