2004-10-13 Helge Hess <helge.hess@opengroupware.org>
+ * SoObjects/SoObjectMethodDispatcher.m: fixed an issue when the
+ clientObject is a WOResponse object. In this case, just return the
+ response instead of starting method processing (v4.3.66)
+
* DynamicElements/WOInput.m: minor code cleanups, be tolerant on
missing value binding (previously printed a warning) (v4.3.65)
/* find client object */
- if ((clientObject = [_ctx clientObject])) {
+ if ((clientObject = [_ctx clientObject]) != nil) {
if (debugOn)
[self debugWithFormat:@"client object set in ctx: %@", clientObject];
}
- else if ((clientObject = [self->object clientObject])) {
+ else if ((clientObject = [self->object clientObject]) != nil) {
if (debugOn)
[self debugWithFormat:@"setting client object: %@", clientObject];
[_ctx setClientObject:clientObject];
}
+
+ /* check whether client object is a response ... */
+
+ if ([clientObject isKindOfClass:[WOResponse class]]) {
+ [self debugWithFormat:@"clientObject is a WOResponse, returning that: %@",
+ clientObject];
+ resultObject = [clientObject retain];
+ [pool release];
+ return [resultObject autorelease];
+ }
// TODO: should check XML-RPC !!!
// (hm, why ? XML-RPC is handled by other dispatcher ?)
if (![url hasSuffix:@"/"]) url = [url stringByAppendingString:@"/"];
url = [url stringByAppendingString:defaultName];
+ [self debugWithFormat:@"redirect to default method %@ of %@: %@",
+ defaultName, self->object, url];
+
r = [[_ctx response] retain];
[r setStatus:302 /* moved */];
[r setHeader:url forKey:@"location"];