Commit 73f4875c authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: do not use the form context title when the current jio_key is different

parent 66a35a25
......@@ -11,13 +11,19 @@
function calculateSynchronousPageTitle(gadget, erp5_document) {
var title = erp5_document.title,
portal_type = erp5_document._links.type.name,
is_module = / Module$/.test(erp5_document._links.type.href);
is_module = / Module$/.test(erp5_document._links.type.href),
traversed_document_jio_key;
if (erp5_document._links.hasOwnProperty('traversed_document')) {
traversed_document_jio_key = erp5_document._links.traversed_document.name;
}
if ((!is_module) &&
erp5_document.hasOwnProperty('_embedded') &&
erp5_document._embedded.hasOwnProperty('_view') &&
erp5_document._embedded._view.hasOwnProperty('_links') &&
erp5_document._embedded._view._links.hasOwnProperty('traversed_document')) {
erp5_document._embedded._view._links.hasOwnProperty('traversed_document') &&
traversed_document_jio_key === erp5_document._embedded._view._links.traversed_document.name) {
// When refreshing the page (after Base_edit), only the form content is recalculated
// and erp5_document.title may contain the old title value.
// Get the title value from the calculated form if possible
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>984.43757.43474.9898</string> </value>
<value> <string>986.50941.53340.16930</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1592560913.76</float>
<float>1600761755.69</float>
<string>UTC</string>
</tuple>
</state>
......
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