Commit d463a5a0 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_dms: Add modificaiton_date to URL to make sure browser reloads the image in ERP5JS

In ERP5JS, when we access a Web Illustration, change it through Edit tab and go back to View, the image is old because the URL and browser does not ask to backend if something has changed.

For example, changing and switching to View tab never changes the URL "web_page_module/9?format=".

If we access it directly it returns 200 for the first time, 304 if we reload and 200 again if we edit this document. This is good and expected.

To fix this issue, modification_date will be passed in the URL and every change will make this property different. Then, browser will reload the page only if we change it.
parent 42c2a915
...@@ -143,7 +143,11 @@ ...@@ -143,7 +143,11 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: "%s?format=" % here.absolute_url()</string> </value> <value> <string encoding="cdata"><![CDATA[
python: "%s?format=&modification_date=%s" % (here.absolute_url(), here.getModificationDate().millis())
]]></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
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