Without "property_type" attributes, entity_metadata_wrapper and reflection on this field can be broken.
Attached patch in comment.

CommentFileSizeAuthor
#1 languagefield-property_type.patch380 bytespaolomainardi
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

paolomainardi’s picture

Sutharsan’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Code style Ok; Works as advertised.
Without this patch Language field module does not play with Entity module. Language fields can not be added using Entity module. Change priority to 'Major'.

To test this patch, create a content type 'with_language', and a language field and run the following code:

  $entity = entity_create('node', array('type' => 'with_language'));
  $entity->uid = 1;
  $entity = entity_metadata_wrapper('node', $entity);
  dpm($entity->getPropertyInfo());

With the patch, the language field will be listed, without the patch not.

paolomainardi’s picture

Thanks @Sutharsan.

johnv’s picture

Version: 7.x-1.x-dev » 7.x-1.1
Category: bug » feature
Priority: Major » Normal
Status: Reviewed & tested by the community » Fixed

Thanks.
It is committed here.

johnv’s picture

But check out #1363522: Add Entity Property Info 'languagefield' for a.o. Search API integration , which adds a 'languagefield' property instead of just a 'text' property.

johnv’s picture

Title: hook_field_info "property_type" attribute missing » hook_field_info "property_type = 'text' " attribute missing
paolomainardi’s picture

Dear @johnv can you attribute the authorship of this commit to my drupal account ?

Thanks a lot!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.