Commit b7668e63 authored by bgm's avatar bgm Committed by Aegir user
Browse files

hook_post Profile.create: add check to avoid odd bugs

parent 8cbc39a7
......@@ -194,7 +194,13 @@ function activityprofile_civicrm_post($op, $objectName, $objectId, &$objectRef)
// but that code only kicks-in when using remoteform and Activity fields.
// This makes it possible to set the contact-type/subtype if using just a plain profile.
if ($objectName == 'Profile' && $op == 'create') {
$profile_id = $objectRef['uf_group_id'];
// Probably never happens, just a precaution
if (empty($objectRef->uf_group_id)) {
return;
}
$profile_id = $objectRef->uf_group_id;
$ctype = Civi::settings()->get('activityprofile_' . $profile_id . '_ctype');
$csubtype = Civi::settings()->get('activityprofile_' . $profile_id . '_csubtype');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment