Skip to content

Commit

Permalink
Fix access callback for tabbed profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
docwilmot committed Jul 30, 2019
1 parent 7129b34 commit 0abb164
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion profile.module
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ function profile_user_edit_access($account, $type_name) {
}

$profile = profile_load_by_user($account, $type_name);
if ($profile && profile_access('update', $profile, $account)) {
if (empty($profile)) {
$profile = profile_create(array('type' => $type_name, 'uid' => $account->uid));
}
if (profile_access('edit', $profile, $account)) {
return TRUE;
}

Expand Down

0 comments on commit 0abb164

Please sign in to comment.