From fd18c4f0c9a3624254174cc99df1e971e2a0c812 Mon Sep 17 00:00:00 2001 From: helge Date: Wed, 5 Oct 2005 12:02:09 +0000 Subject: [PATCH] disabled assoc-push in takeValues of submit button (#1568) git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1156 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-appserver/NGObjWeb/ChangeLog | 8 ++++++ sope-appserver/NGObjWeb/Defaults.plist | 1 + .../NGObjWeb/DynamicElements/WOSubmitButton.m | 28 +++++++++++++++---- sope-appserver/NGObjWeb/Version | 2 +- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index af6c1430..e9547aba 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,3 +1,11 @@ +2005-10-05 Helge Hess + + * DynamicElements/WOSubmitButton.m: disable KVC push for 'value' + binding in -takeValuesFromRequest:inContext:. This is usually not + required but results in issue #1568 on OSX. The old behaviour can + be reenabled by settin ghte WOSubmitButtonEnableValueSync default to + YES (v4.5.205) + 2005-10-03 Helge Hess * WODisplayGroup.m: added -qualifyDataSourceAndReturnDisplayCount diff --git a/sope-appserver/NGObjWeb/Defaults.plist b/sope-appserver/NGObjWeb/Defaults.plist index 8ee9a096..7e5f05cc 100644 --- a/sope-appserver/NGObjWeb/Defaults.plist +++ b/sope-appserver/NGObjWeb/Defaults.plist @@ -117,6 +117,7 @@ WOSimpleHTTPParserHeavyDebugEnabled = NO; WOSimpleHTTPParserMaxUploadSizeInKB = 262144; WOStatsStylesheetName = "WOStats.xsl"; + WOSubmitButtonEnableValueSync = NO; WOUseRelativeURLs = YES; WOUseGlobalCookiePath = YES; WOValueAssociationsCacheSize = 200; diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOSubmitButton.m b/sope-appserver/NGObjWeb/DynamicElements/WOSubmitButton.m index 840a2d35..fe06a937 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOSubmitButton.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOSubmitButton.m @@ -44,9 +44,17 @@ @implementation WOSubmitButton +static BOOL WOSubmitButtonEnableValueSync = NO; + + (int)version { return 2; } ++ (void)initialize { + NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; + + WOSubmitButtonEnableValueSync = + [ud boolForKey:@"WOSubmitButtonEnableValueSync"]; +} - (id)initWithName:(NSString *)_name associations:(NSDictionary *)_config @@ -91,13 +99,23 @@ return; } - if ((formValue = [_rq formValueForKey:OWFormElementName(self, _ctx)])) { - //NSLog(@"%@: value=%@ ..", [self elementID], formValue); + if ((formValue = [_rq formValueForKey:OWFormElementName(self, _ctx)])!=nil) { + // [self debugWithFormat:@"%@: value=%@ ..", [self elementID], formValue]; - if ([self->value isValueSettable]) { - [self->value setStringValue:formValue - inComponent:[_ctx component]]; + if (WOSubmitButtonEnableValueSync) { + /* + We need this because some associations (eg + WOKeyPathAssociationSystemKVC) report "isValueSettable" as YES, + but raise an exception afterwards. + + This section is disabled per default since its usually not required. + + See OGo bug #1568 for details. + */ + if ([self->value isValueSettable]) + [self->value setStringValue:formValue inComponent:[_ctx component]]; } + if ((self->action != nil) || (self->pageName != nil)) [_ctx addActiveFormElement:self]; } diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index 46ce5de7..9efa18fa 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=204 +SUBMINOR_VERSION:=205 # v4.5.122 requires libNGExtensions v4.5.153 # v4.5.91 requires libNGExtensions v4.5.134 -- 2.39.5