I am writing another module that I want to have take actions based on info stored in Profile2 fields. It should be able to read and update fields that already exist and if the field does not exist, it should be able to create the field for the user. I'm not looking to create a new field definition, just read, update and create already defined fields.

From looking over the source, I see hooks to modify the flow while using the official Profile2 pages, but I don't see anything about doing this from another different user module. Do you know of any modules that already do this so I can examine some working code to figure out the process? Or might this be documented someplace i haven't found yet?

Any information appreciated.

Comments

MacRonin’s picture

Passing along an response to my question that was written by @tedbow. He had a presentation on Entities at tonight's Drupal Meet-up in NYC and created a small demo module to display/update a field in Profile2

http://drupal.org/sandbox/tedbow/1515430

Thanks @tedbow

joachim’s picture

Status: Active » Fixed

WIth any entity you can load it with entity_load(), change properties of the object such as fields, as then entity_save() it again.

Status: Fixed » Closed (fixed)

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