I'm using profile2 to store user profiles and I *really* want to store addresses in these profiles. I figured that a profile can't be all that different from a node so I dug into the module to see what is going on. What I ended up doing was hacking on location_cck.module to make it with profile2. This largely consisted of the following:

  1. modify every place that checks for $entity_type == "node" and add a branch for "profile2"
  2. figure out what to store in location_instance.nid and location_instance.pid columns. I opted to use the profile2's pid for both.
  3. to prevent clashes in the location_instance table between a node and profile2 where the node's nid/vid is the same value as profile's pid, I modified the genid for the profile2 rows to have the entity type prepended: profile2:cck:field_address:1

On the 3rd item above, I debated adding the entity type to the genid for nodes but it decided not to in order to minimize issues when the location module gets the capability to work with any entity.

I'm including a patch in case anyone finds this useful, wants to improve it, or if the module maintainers want to include in 7.x-3-x.

CommentFileSizeAuthor
location_cck.module.patch3.12 KBbkat

Comments

jamuy’s picture

Assigned: Unassigned » jamuy

Muchas gracias por el patch, me encontraba realizando lo mismo y se me dio por buscarlo. Claro que mis modificaciones aun no estaban funcionando a la perfección.

Esperemos que este en breve en el trunk del desarrollo.

Saludos.

Taxoman’s picture

Assigned: jamuy » Unassigned
Category: bug » feature
Priority: Normal » Major
Taxoman’s picture

Issue summary: View changes

typo fix