From e4e91ee64c762b5568e23371fe46576c3ccb5bbe Mon Sep 17 00:00:00 2001 From: Kyle Browning Date: Fri, 22 Apr 2011 20:28:53 -0700 Subject: [PATCH] Fixes issue with comments not working in d7 --- DIOSComment.m | 19 +++++++++++++------ DIOSConfig.h | 18 ++++-------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/DIOSComment.m b/DIOSComment.m index 378bbf2..14c3da9 100644 --- a/DIOSComment.m +++ b/DIOSComment.m @@ -88,9 +88,12 @@ - (void) addComment:(NSString*)nid subject:(NSString*)aSubject body:(NSString*)a [comment setObject:nid forKey:@"nid"]; if(aSubject != nil) [comment setObject:aSubject forKey:@"subject"]; - if(aBody != nil) - [comment setObject:aBody forKey:@"comment"]; - + if(aBody != nil) { + NSDictionary *bodyValues = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:aBody, nil] forKeys:[NSArray arrayWithObjects:@"value", nil]]; + NSDictionary *languageDict = [NSDictionary dictionaryWithObject:[NSArray arrayWithObject:bodyValues] forKey:@"und"]; + [comment setObject:languageDict forKey:@"comment_body"]; + [comment setObject:@"und" forKey:@"language"]; + } if([[self userInfo] objectForKey:@"uid"] != nil) { id temp = [[self userInfo] objectForKey:@"uid"]; [comment setObject:[temp stringValue] forKey:@"uid"]; @@ -114,9 +117,12 @@ - (void) updateComment:(NSString*)cid subject:(NSString*)aSubject body:(NSString [comment setObject:cid forKey:@"cid"]; if(aSubject != nil) [comment setObject:aSubject forKey:@"subject"]; - if(aBody != nil) - [comment setObject:aBody forKey:@"comment"]; - + if(aBody != nil) { + NSDictionary *bodyValues = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:aBody, nil] forKeys:[NSArray arrayWithObjects:@"value", nil]]; + NSDictionary *languageDict = [NSDictionary dictionaryWithObject:[NSArray arrayWithObject:bodyValues] forKey:@"und"]; + [comment setObject:languageDict forKey:@"comment_body"]; + [comment setObject:@"und" forKey:@"language"]; + } if([[self userInfo] objectForKey:@"uid"] != nil) { id temp = [[self userInfo] objectForKey:@"uid"]; [comment setObject:[temp stringValue] forKey:@"uid"]; @@ -128,4 +134,5 @@ - (void) updateComment:(NSString*)cid subject:(NSString*)aSubject body:(NSString [self runMethod]; return; } + @end \ No newline at end of file diff --git a/DIOSConfig.h b/DIOSConfig.h index f7962dc..cdc2127 100644 --- a/DIOSConfig.h +++ b/DIOSConfig.h @@ -51,19 +51,9 @@ #ifdef DEV #define DRUPAL_API_KEY @"4b2d7ef98d720386e0d2022842847404" -#define DRUPAL_SERVICES_URL @"http://drupal7/test4" -#define DRUPAL_URL @"http://demo.kylebrowning.com/" -#define DRUPAL_DOMAIN @"testing" +#define DRUPAL_SERVICES_URL @"http://dev.example.com/services/plist" +#define DRUPAL_URL @"http://dev.example.com" +#define DRUPAL_DOMAIN @"dev.example.com" +#endif //THis is the constant for none in Drupal7 http://api.drupal.org/api/constant/LANGUAGE_NONE/7 #define DRUPAL_LANGUAGE @"und" - -#endif - -#define DRUPAL_CELL_DEFAULT_IMAGE @"http://demo.kylebrowning.com/sites/default/files/imagecache/iphone/4986607783_45b49e2493_o.jpg" -#define DRUPAL_IMAGECACHE_URL @"sites/default/files/imagecache/iphone/" -#define DRUPAL_NC_SYSTEM @"DRUPALNCSYSTEM" -#define DRUPAL_METHOD_DONE @"DRUPALMETHODDONE" -#define DRUPAL_NODE_METHOD_DONE @"DRUPALNODEMETHODDONE" -#define DRUPAL_CATEGORY_VID @"1" -#define DRUPAL_VIEWS_IMAGE_FIELD @"files_node_data_field_image_filepath" -#define DRUPAL_NODE_IMAGE_FIELD @"field_image" \ No newline at end of file