From 89114838baec3ba578b8829548eea71356cb7225 Mon Sep 17 00:00:00 2001
From: Ramin Yaghoubzadeh <ryaghoubzadeh@uni-bielefeld.de>
Date: Mon, 16 Feb 2015 14:25:18 +0100
Subject: [PATCH] Deep setters seem to work locally, time for real IU
 integration.

---
 ipaacalib/cpp/src/ipaaca-payload.cc | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/ipaacalib/cpp/src/ipaaca-payload.cc b/ipaacalib/cpp/src/ipaaca-payload.cc
index 7393ab6..58ea2e3 100644
--- a/ipaacalib/cpp/src/ipaaca-payload.cc
+++ b/ipaacalib/cpp/src/ipaaca-payload.cc
@@ -251,16 +251,20 @@ IPAACA_EXPORT rapidjson::Value& PayloadDocumentEntry::get_or_create_nested_value
 			//Value key;
 			//key.SetString(pep->addressed_key, allocator);
 			//parent_value.AddMember(key, *json_value, allocator);
-			Value key;
+			rapidjson::Value key;
 			key.SetString(pep->addressed_key, allocator);
-			// FIXME LAST this complains
 			auto it = parent_value.FindMember(key);
 			if (it != parent_value.MemberEnd()) {
-				return parent_value[pep->addressed_key.c_str()];
+				IPAACA_INFO("Returning existing child Value")
+				return parent_value[key];
 			} else {
+				IPAACA_INFO("Creating new child Value")
 				rapidjson::Value val;
 				parent_value.AddMember(key, val, allocator);
-				return parent_value[key];
+				IPAACA_INFO("Returning new child Value")
+				rapidjson::Value rkey;
+				rkey.SetString(pep->addressed_key, allocator);
+				return parent_value[rkey];
 			}
 		}
 	}
-- 
GitLab