Hi guys,
I think you can help with this issue. I have the following code:
$node_wrapper = entity_metadata_wrapper('node', $node);
$locations = $node_wrapper->field_locations->value();
Normally you can access in this way to your properties. This is very useful when you install the locale module and you don't wanna fight against the language properties in your custom fields. The main problem is when I get this error:
EntityMetadataWrapperException: Unknown data property field_locations. in EntityStructureWrapper->getPropertyInfo() (line 339 of /home/tanga0/public_html/apps/quecomida/sites/all/modules/entity/includes/entity.wrapper.inc).
So I think this issue is related to this one:
http://drupal.org/node/1366642
Any idea? Thanks!
Comments
Comment #1
tce commentedI've just come across this error. Also using Ctools entity_metadata_wrapper() and trying to view and save a Geolocation field.
@tangamampilia, does the patch work http://drupal.org/files/geolocation.module.patch?
Update: patch works fine for me
Comment #2
tangamampilia commentedLet me check later... thanks tce!
Comment #3
Ananya MultiTech commentedhi...
just a small suggestion : I have observed that value() is supported only in case of simple properties like integer, text etc.. But if u have Taxonomy or Node Reference or User Entity Reference field then you can use raw() if u want to compare IDs or use label() if u want readable code..
I used it like this :
**Lot of useful functions available in entity.wrapper.inc
Comment #4
alex.bukach commentedThe patch worked fine for me too. Why not to commit it?
Comment #5
alex.bukach commentedProperty types and latitude/longitude property are added.
Comment #6
derjochenmeyer commentedLast patch had local dir structure in it. Please use / test updated patch. If this works, lets commit it to dev.
Comment #7
alex.bukach commentedOh, right, derjochenmeyer. Thanks for fixing it!
Comment #8
derjochenmeyer commentedThis #1366642: Property Info callback for Entity API is fixed.
Comment #9
derjochenmeyer commentedDont know if this got fixed with another commit or if its still relevant.
Comment #10
derjochenmeyer commentedComment #11
derjochenmeyer commentedSeems to be fixed.
Comment #13
mykola dolynskyiHi. I got this trying to wrap the entity of type node
EntityMetadataWrapperException: Unknown data property field_usr. in EntityStructureWrapper->getPropertyInfo() (line 335 of /var/www/extranet/sites/all/modules/entity/includes/entity.wrapper.inc).
field_usr -- is field of type entityreference
node bundle i am trying to wrap has no this field
version of module 1.7
Comment #14
alex.bukach commented@Mykola Dolynskyi why do you think it's related to Geolocation Field module?
Comment #15
mykola dolynskyi@Alex Bukach same errorm same line of code
it is related to entity_metadata_wrapper itself
Comment #16
alex.bukach commented@Mykola Dolynskyi in the reported case the field was geolocation field, and therefore the issue was related to this module. You say in your case it's entityreference field, so it sounds to be completely not related to geolocation field module.