Skip to content

Commit

Permalink
Fixes issue with comments not working in d7
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Browning authored and Kyle Browning committed Apr 23, 2011
1 parent 139454f commit e4e91ee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
19 changes: 13 additions & 6 deletions DIOSComment.m
Expand Up @@ -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"];
Expand All @@ -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"];
Expand All @@ -128,4 +134,5 @@ - (void) updateComment:(NSString*)cid subject:(NSString*)aSubject body:(NSString
[self runMethod];
return;
}

@end
18 changes: 4 additions & 14 deletions DIOSConfig.h
Expand Up @@ -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"

0 comments on commit e4e91ee

Please sign in to comment.