Do we need this?
Eg, if we have a contrib module profile_address that defines a whizzy address type with ponies, should we have a hook for it to do that?
Do we need this?
Eg, if we have a contrib module profile_address that defines a whizzy address type with ponies, should we have a hook for it to do that?
Comments
Comment #1
fagoI don't think we need that - it can be create via the API funciton as the profile2 module does itself too. Also the field API works that way - having a function to create it but no hook.
But anyway, I'd be fine a hook too.
Comment #2
fagoI've just ported the current code to the entity API, thus we can easily implement that by defining the types as exportable. I've already done so, it's working fine.
However currently it's called as by default: hook_default_profile_type(), but we could easily change it by setting the appropriate property in hook_entity_info and adapting the code.
I think hook_default_profile_type() is fine, as it says that types can be defined outside of this hook too. Also the hook doesn't return info about types, it does return types defined by default. So I think the current hook name is even better, however I don't feel strong about this so feel free to change that.
Comment #3
fagoWe have hook_default_profile_type().