Commit 506f646f authored by Romain Courteaud's avatar Romain Courteaud

ERP5Storage: get now set parent_relative_url if available

This ensure that document created during synchro contains the same properties on local and remote storage.
parent 78ad5715
...@@ -85,6 +85,11 @@ ...@@ -85,6 +85,11 @@
prefix_length, prefix_length,
result; result;
if (json._links.hasOwnProperty('parent')) {
converted_json.parent_relative_url =
new URI(json._links.parent.href).segment(2);
}
form_data_json.form_id = { form_data_json.form_id = {
"key": [form.form_id.key], "key": [form.form_id.key],
"default": form.form_id["default"] "default": form.form_id["default"]
......
...@@ -175,6 +175,9 @@ ...@@ -175,6 +175,9 @@
"_links": { "_links": {
type: { type: {
name: "Person" name: "Person"
},
parent: {
href: "urn:jio:get:foo_module"
} }
}, },
"_embedded": { "_embedded": {
...@@ -244,6 +247,7 @@ ...@@ -244,6 +247,7 @@
.then(function (result) { .then(function (result) {
deepEqual(result, { deepEqual(result, {
portal_type: "Person", portal_type: "Person",
parent_relative_url: "foo_module",
reference: "bar", reference: "bar",
reference_non_editable: "bar", reference_non_editable: "bar",
title: "foo" title: "foo"
...@@ -1995,6 +1999,9 @@ ...@@ -1995,6 +1999,9 @@
"_links": { "_links": {
type: { type: {
name: "Person" name: "Person"
},
parent: {
href: "urn:jio:get:bar_module"
} }
}, },
"_embedded": { "_embedded": {
...@@ -2135,6 +2142,7 @@ ...@@ -2135,6 +2142,7 @@
equal(result_list.length, 2); equal(result_list.length, 2);
deepEqual(result, { deepEqual(result, {
portal_type: "Person", portal_type: "Person",
parent_relative_url: "bar_module",
reference: "bar", reference: "bar",
reference_non_editable: "bar", reference_non_editable: "bar",
title: "foo" title: "foo"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment