Commit 468bfda6 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Don't add institution profile access before profile is created (bug #807278)



When arriving at Mahara for the first time via SSO, the newly created user
is added to an institution.  During that process an attempt is made to add
institution access to the user's profile view before it gets created.  This
patch adds a check (and when the profile view eventually gets created,
institution access is added for all the owner's institutions).

Change-Id: I6a6d4fc3dcb324905e67f4d52aac4160cf9ce089
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 8fd2aced
......@@ -231,8 +231,9 @@ class Institution {
// Give institution members access to user's profile page
require_once('view.php');
$profileview = $userobj->get_profile_view();
$profileview->add_owner_institution_access(array($this->name));
if ($profileview = $userobj->get_profile_view()) {
$profileview->add_owner_institution_access(array($this->name));
}
db_commit();
}
......
Supports Markdown
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