From fa5eaef5708636d53dcdebba7b35caeb8bbfd133 Mon Sep 17 00:00:00 2001 From: Bruno Farache Date: Fri, 16 May 2014 10:07:01 -0300 Subject: [PATCH] MOBILESDK-20 - LRJSONObjectWrapper parameters weren't correctly being set --- .../liferay/mobile/sdk/test/portal/ServiceContextTest.java | 2 ++ ios/Source/Core/LRJSONObjectWrapper.m | 4 ++-- ios/Test/Portal/ServiceContextTest.m | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/android/src/test/java/com/liferay/mobile/sdk/test/portal/ServiceContextTest.java b/android/src/test/java/com/liferay/mobile/sdk/test/portal/ServiceContextTest.java index a50940c7..37959a37 100644 --- a/android/src/test/java/com/liferay/mobile/sdk/test/portal/ServiceContextTest.java +++ b/android/src/test/java/com/liferay/mobile/sdk/test/portal/ServiceContextTest.java @@ -46,6 +46,8 @@ public void addBookmarkEntry() throws Exception { JSONObject jsonObject = new JSONObject(); jsonObject.put("uuid", uuid); + jsonObject.put("addGroupPermissions", true); + jsonObject.put("addGuestPermissions", true); JSONObjectWrapper serviceContext = new JSONObjectWrapper(jsonObject); JSONObject entry = addBookmarkEntry("test", serviceContext); diff --git a/ios/Source/Core/LRJSONObjectWrapper.m b/ios/Source/Core/LRJSONObjectWrapper.m index afbfb990..5596ccea 100644 --- a/ios/Source/Core/LRJSONObjectWrapper.m +++ b/ios/Source/Core/LRJSONObjectWrapper.m @@ -59,10 +59,10 @@ - (void)_addJSONObjectWithParams:(NSMutableDictionary *)params name:(NSString *)name { for (NSString *key in self.jsonObject) { - name = [NSString stringWithFormat:@"%@.%@", name, key]; + NSString *paramKey = [NSString stringWithFormat:@"%@.%@", name, key]; id value = [self.jsonObject objectForKey:key]; - [params setObject:value forKey:name]; + [params setObject:value forKey:paramKey]; } } diff --git a/ios/Test/Portal/ServiceContextTest.m b/ios/Test/Portal/ServiceContextTest.m index 5ffaf95b..57273f61 100644 --- a/ios/Test/Portal/ServiceContextTest.m +++ b/ios/Test/Portal/ServiceContextTest.m @@ -26,7 +26,9 @@ - (void)testAddBookmarkEntry { NSString *uuid = [[NSUUID UUID] UUIDString]; NSDictionary *jsonObject = @{ - @"uuid": uuid + @"uuid": uuid, + @"addGroupPermissions": @(YES), + @"addGuestPermissions":@(YES) }; LRJSONObjectWrapper *serviceContext = [[LRJSONObjectWrapper alloc]