Closed (fixed)
Project:
MongoDB
Version:
7.x-1.0-beta2
Component:
Field storage
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Oct 2011 at 01:17 UTC
Updated:
17 Apr 2012 at 18:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
paul kim consulting commentedI've fixed this by changing
In mongodb_field_storage_field_storage_load() to
Comment #2
misc commentedPacth for the above fix.
Comment #3
misc commentedComment #5
misc commentedComment #6
misc commentedCould somebody test if this patch works, so we could put in dev?
Comment #7
misc commentedCommitted to the latest dev.
Comment #8
Janne Salo commentedI'm reopening this for two reasons:
1. The provided fix causes bug #1497456: Field Storage: undefined index: nid in hook field_storage_load
2. It totally breaks (for example) comments' fields. This is because comments have a field named 'nid'! Consider what happens when that is used as $entity_id in the loop. Right, bad things.
I'll try to come up with a patch that would provide best of both worlds. In the meantime, I strongly suggest NOT using this patch (nor the current dev version).
Comment #9
Janne Salo commentedHere's my suggestion for a patch. This one doesn't break comments and doesn't throw notices. I do not know if it still serves its original purpose but I can't see any reason why it wouldn't. I'm a bit unsure whether any field other than _id in any type of result should ever be considered the entity id. For revisions, _id probably equals vid, the same way _id equals nid for current nodes? Isn't this desired? (I might be completely wrong here, since I'm not familiar with revisioning or workbench_moderation modules).
Comment #10
Janne Salo commentedComment #12
Janne Salo commentedComment #13
Janne Salo commentedSorry, the previous patch was for 7.x-1.x-dev. This one's for the version actually mentioned in the issue.
Comment #14
Janne Salo commentedNow I accidentally changed the version... Seems I'm causing more harm than good.
Comment #15
misc commentedComment #16
misc commentedThanks, committed to the latest dev.