Skip to content
Browse files

NOBUG: improved check of user context existence

When importing users from backup, their CONTEXT_USER level context is
not created yet. Therefore, make_context_subobj() creates $user->context
object here with empty values. So we have to call full
get_context_instance() here to create the context.
  • Loading branch information...
1 parent c17e376 commit c36671d72c68317f33f250ca919a978c71f8bf5b @mudrd8mz mudrd8mz committed Jun 17, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 user/index.php
View
2 user/index.php
@@ -712,7 +712,7 @@ function checkchecked(form) {
}
}
- if (!isset($user->context)) {
+ if (empty($user->context->id)) {
$usercontext = get_context_instance(CONTEXT_USER, $user->id);
} else {
$usercontext = $user->context;

0 comments on commit c36671d

Please sign in to comment.
Something went wrong with that request. Please try again.