View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001400 | SOGo | SOPE | public | 2011-07-29 09:01 | 2011-10-05 13:16 |
| Reporter | buzzdee | Assigned To | |||
| Priority | normal | Severity | crash | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | 1.3.8 | ||||
| Fixed in Version | 1.3.9 | ||||
| Summary | 0001400: unhandled exception in OGo with sope/gnustep-base combination | ||||
| Description | Hi, trying to enter a project in OGo webinterface, using sope linked against gnustep-base instead of libFoundation, leads to an unhandled exception in the Answer I got from Helge: attached patch adds this mentioned exception handler, and makes OGo happy with this regard. Could it please reviewed and added to SOPE. | ||||
| Additional Information | #0 -[NSException raise] (self=0x843a3688, _cmd=0x250bb990) at NSException.m:956 | ||||
| Tags | No tags attached. | ||||
|
2011-07-29 09:01
|
patch-sope-appserver_NGObjWeb_Associations_WOKeyPathAssociation_m (830 bytes)
$OpenBSD$
--- sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m.orig Thu Jul 28 14:21:39 2011
+++ sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m Thu Jul 28 20:13:04 2011
@@ -960,7 +964,17 @@ static BOOL _setValue(WOKeyPathAssociation *self, id _
// we do not check the return value, because a set is allowed to fail
// (in SOPE ;-) [if there is no accessor, a backsync is just ignored]
#if 1
- _setValue(self, _value, _component);
+ NS_DURING
+ {
+ _setValue(self, _value, _component);
+ }
+ NS_HANDLER
+ {
+ if ([[localException name] isEqualToString: @""])
+ [self logWithFormat:@"could not set value %@ component %@",
+ _value, _component];
+ }
+ NS_ENDHANDLER
#else
if (!_setValue(self, _value, _component)) {
[self logWithFormat:@"could not set value %@ component %@",
|
|
Another approach is to implement the missing KVC as a category to NSDictionary. http://bugzilla.opengroupware.org/bugzilla/show_bug.cgi?id=1990 Both approaches tested and work fine with OGo. |
|
|
2011-07-29 10:02
|
fix-for-OGo-otherwise-running-into-explicit-exception.diff (3,417 bytes)
$OpenBSD$
--- sope-core/NGExtensions/FdExt.subproj/GNUmakefile.orig Fri Jul 29 11:38:47 2011
+++ sope-core/NGExtensions/FdExt.subproj/GNUmakefile Fri Jul 29 11:38:27 2011
@@ -15,6 +15,7 @@ FdExt_OBJC_FILES = \
NSCalendarDate+matrix.m \
NSData+gzip.m \
NSData+misc.m \
+ NSDictionary+KVC.m \
NSDictionary+misc.m \
NSEnumerator+misc.m \
NSException+misc.m \
$OpenBSD$
--- sope-core/NGExtensions/FdExt.subproj/NSDictionary+KVC.m.orig Fri Jul 29 11:36:55 2011
+++ sope-core/NGExtensions/FdExt.subproj/NSDictionary+KVC.m Fri Jul 29 11:36:55 2011
@@ -0,0 +1,57 @@
+/*
+ Copyright (C) 2000-2008 SKYRIX Software AG
+
+ This file is part of SOPE.
+
+ SOPE is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with SOPE; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+
+#if GNUSTEP_BASE_LIBRARY
+
+#import "common.h"
+#import "NSDictionary+KVC.h"
+
+@implementation NSDictionary(KVC)
+
+// TODO: it should be addressed to gnustep-base
+
+- (id)valueForUndefinedKey:(NSString *)key
+{
+ return nil;
+}
+
+- (id)handleQueryWithUnboundKey:(NSString *)key
+{
+ return nil;
+}
+
+- (void)setValue:(id)value forUndefinedKey:(NSString *)key
+{
+ return;
+}
+
+- (void)handleTakeValue:(id)value forUnboundKey:(NSString *)key
+{
+ return;
+}
+
+@end /* NSDictionary(KVC) */
+
+void __link_NSDictionary_KVC() {
+ __link_NSDictionary_KVC();
+}
+
+#endif
$OpenBSD$
--- sope-core/NGExtensions/NGExtensions/NSDictionary+KVC.h.orig Fri Jul 29 11:36:55 2011
+++ sope-core/NGExtensions/NGExtensions/NSDictionary+KVC.h Fri Jul 29 11:36:55 2011
@@ -0,0 +1,39 @@
+/*
+ Copyright (C) 2000-2008 SKYRIX Software AG
+
+ This file is part of SOPE.
+
+ SOPE is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with SOPE; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+
+#ifndef __NGExtensions_NSDictionary_KVC_H__
+#define __NGExtensions_NSDictionary_KVC_H__
+
+#import <Foundation/NSDictionary.h>
+
+@interface NSDictionary(KVC)
+
+- (id)valueForUndefinedKey:(NSString *)key;
+
+- (id)handleQueryWithUnboundKey:(NSString *)key;
+
+- (void)setValue:(id)value forUndefinedKey:(NSString *)key;
+
+- (void)handleTakeValue:(id)value forUnboundKey:(NSString *)key;
+
+@end
+
+#endif /* __NGExtensions_NSDictionary_KVC_H__ */
|
|
I guest the second approach is faster than the first one. |
|
|
Yes, I did not measured any timings, nor felt any difference when using the web interface, but I guess you are generally right. |
|
|
Could the second patch be added to SOPE? |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2011-07-29 09:01 | buzzdee | New Issue | |
| 2011-07-29 09:01 | buzzdee | File Added: patch-sope-appserver_NGObjWeb_Associations_WOKeyPathAssociation_m | |
| 2011-07-29 10:02 | buzzdee | Note Added: 0002756 | |
| 2011-07-29 10:02 | buzzdee | File Added: fix-for-OGo-otherwise-running-into-explicit-exception.diff | |
| 2011-07-29 12:53 | ludovic | Note Added: 0002762 | |
| 2011-07-29 13:00 | buzzdee | Note Added: 0002763 | |
| 2011-10-05 09:56 | buzzdee | Note Added: 0002866 | |
| 2011-10-05 13:16 | ludovic | Note Added: 0002868 | |
| 2011-10-05 13:16 | ludovic | Status | new => closed |
| 2011-10-05 13:16 | ludovic | Resolution | open => fixed |
| 2011-10-05 13:16 | ludovic | Fixed in Version | => 1.3.9 |