Merge pull request #208 from zentyal/jgarcia/wocontext-fun

User context activation when cached
This commit is contained in:
Enrique J. Hernández
2015-11-18 06:56:16 +01:00
2 changed files with 5 additions and 0 deletions

View File

@@ -73,6 +73,8 @@ static NSMapTable *contextsTable = nil;
[userContext autorelease];
[contextsTable setObject: userContext forKey: username];
}
else
[userContext activate];
return userContext;
}

View File

@@ -180,6 +180,9 @@
[NSException raise: NSInvalidArgumentException
format: @"'_name' must not be an empty string"];
context = [[WOApplication application] context];
if (!context)
[self errorWithFormat: @"Error: initializing a SOGoObject (named %@) "
@"without wocontext", _name];
nameInContainer = [_name copy];
container = _container;
if ([self doesRetainContainer])