After creating a search api index based on the relation entity, the following error occurs :
EntityMetadataWrapperException: Missing data values. in EntityMetadataWrapper->value() (line 73 of entity/includes/entity.wrapper.inc)
This error won't leave until you remove the index.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | 1271046-17.patch | 1.81 KB | kalman.hosszu |
| #13 | 1271046-expose-more-properties.patch | 8.19 KB | jsacksick |
| #5 | 1271046-expose-more-properties.patch | 3.03 KB | jsacksick |
| #4 | 1271046-expose-more-properties.patch | 3.25 KB | damien tournoud |
| #3 | 1271046-expose-more-properties.patch | 3.33 KB | damien tournoud |
Comments
Comment #1
Letharion commentedComment #2
jsacksick commentedHere is the
debug_backtrace() :http://pastebin.com/th0vkBkG
Comment #3
damien tournoud commentedI looked into this more. One of the problem is that relation only exposes the generic
list<entity>instead of the entity-type specific ones. As a consequence you cannot introspect the relation structure.Moreover, the relation module doesn't properly exposes the
ridproperty, so Search API fails to index it.Comment #4
damien tournoud commentedSame patch with cleanup.
Comment #5
jsacksick commentedWhat's the status of this issue ? Tested, just need to correct a line in the getter callback which should return the entity_ids instead of entities directly.
Here is the new patch.
Comment #6
chx commentedThis is nice but I really dislike the $bundle_properties = &$info['relation']['bundles'][$bundle]['properties']; construct (will file issue against entity API as well) why can't we just do $info['relation']['bundles'][$bundle]['properties']; = $bundle_properties at the end?
Comment #7
damien tournoud commentedNo we cannot because there could be some properties there to begin with. We could
+=at the end, but that's going to be ugly very quick. I think this construct is the cleanest we can do.Comment #8
chx commentedThere could be some properties coming from where?
this is the current code and I wish it didnt look that , either. There is no incoming info argument, there is no previous setting of $info['relation']['bundles']. And yes. I would rather fight this here and now than in the entity API where, as I said, I will go next.
You will burn yourself so badly with these unneeded references one day :/
Comment #9
chx commentedCommitted. (Against my better judgement.)
Comment #11
chx commentedInstall eva and this breaks. Rolled back this along with 606d433f65fbb511511397e52a35ea75bb3b5fcc #1265434: Expose relation in an entity list wrapper containing all related entities because I think that one depended on this one.
Edit: reproduction steps, click the 'display fields' of a ctools-exported relation type (might work with db relation type too I didnt check) and click save. If you have eva installed then you get a WSOD.
Edit2: Here is the patch to apply on top of HEAD to reproduce the problem.
Comment #12
chx commentedupon field info cache clear, eva calls get views which leads to entity api call the properties callback which leads to a call to relation_get_types which calls field_info_instance. The circle is now complete.
Comment #13
jsacksick commentedThis patch seems to work with me.
Properties per bundle are now added in the
hook_entity_property_info_alter().instead ofhook_entity_property_info()..Anyway,
relation_type_ensure_instance()shouldn't be called inrelation_get_types()becauserelation_get_types()is itself called in thehook_entity_property_info()and calling field_info_instance (which is in relation_type_ensure_instance) in an entity info hook is not a good idea and could cause issues just like this one.Comment #14
chx commentedCommitted, thanks.
Comment #16
chx commentedComment #17
kalman.hosszu commentedHi,
I attached a patch to test the new feature.
Kálmán
Comment #18
chx commentedThanks a ton.