Commit e97c2824 authored by Tristan Cavelier's avatar Tristan Cavelier

erp5storage.js put bug fix

parent f581cfdf
...@@ -287,9 +287,23 @@ ...@@ -287,9 +287,23 @@
// XXX docstring // XXX docstring
ERP5Storage.onView.default.put = function (metadata, options) { ERP5Storage.onView.default.put = function (metadata, options) {
return onViewDefaultGet.call(this, metadata, options) return getSiteDocument(this._url).
then(function (site_hal) {
return jIO.util.ajax({
"type": "GET",
"url": UriTemplate.parse(site_hal._links.traverse.href)
.expand({
relative_url: metadata._id,
view: options._view || "view"
}),
"xhrFields": {
withCredentials: true
}
});
})
.then(function (result) { .then(function (result) {
/*jslint forin: true */ /*jslint forin: true */
result = JSON.parse(result.target.responseText);
var put_action = result._embedded._view._actions.put, var put_action = result._embedded._view._actions.put,
renderer_form = result._embedded._view, renderer_form = result._embedded._view,
data = new FormData(), data = new FormData(),
......
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