My question is related to: Using entity metadata wrapper with custom entity type

I know that I should inform EMW how to work with entity properties via hook_entity_property_info_alter

but what about custom fields added via Field API to custom entity. I'm trying to set value of that kind of field via EMW but after entity save, field (db table) is always empty.

  • Field types that EMW knows about should be handled automatically I think, is this a custom field type?
    – Clive
    Sep 4, 2015 at 21:26
  • This is a entityreference field type (to user entity). Creation code is in related question.
    – Codium
    Sep 4, 2015 at 21:31
  • @Clive I've forgotten to set fieldable => true in entity definition hook. Now EMW works.
    – Codium
    Sep 4, 2015 at 21:51
  • 1
    That would probably make a useful self-answer, I can imagine others missing the same thing
    – Clive
    Sep 4, 2015 at 21:54

1 Answer 1


I've forgotten to set fieldable => true in hook_entity_info. Now EMW works

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.