Commit 50dd862b authored by Fabien Morin's avatar Fabien Morin

before, a web_page accessed through web_section or through

web_page_module where served using a different cache. This was due to the fact
that web_page.getPath() was used as key to find the corresponding cache (and
the path of a web page is not the same through web_page_module and through a
web_site). Now, orginal_path is stored on web_section and used
instead of path. This permit to served cached web_page throught web_page_module
or throught a web_site.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29967 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e9a2784d
...@@ -196,6 +196,7 @@ class WebSection(Domain, PermanentURLMixIn): ...@@ -196,6 +196,7 @@ class WebSection(Domain, PermanentURLMixIn):
id=document.getReference(), id=document.getReference(),
original_container=document.getParentValue(), original_container=document.getParentValue(),
original_id=document.getId(), original_id=document.getId(),
original_path=document.getPath(),
editable_absolute_url=document.absolute_url())).__of__(self) editable_absolute_url=document.absolute_url())).__of__(self)
# Try to use a custom renderer if any # Try to use a custom renderer if any
custom_render_method_id = self.getCustomRenderMethodId() custom_render_method_id = self.getCustomRenderMethodId()
......
...@@ -146,7 +146,8 @@ class CachedConvertableMixin: ...@@ -146,7 +146,8 @@ class CachedConvertableMixin:
if self.isTempObject(): if self.isTempObject():
return getattr(aq_base(self), 'temp_conversion_data', {})[cache_id] return getattr(aq_base(self), 'temp_conversion_data', {})[cache_id]
for cache_plugin in self._getCacheFactory().getCachePluginList(): for cache_plugin in self._getCacheFactory().getCachePluginList():
cache_entry = cache_plugin.get(self.getPath(), DEFAULT_CACHE_SCOPE) document_path = getattr(self, 'original_path', self.getPath())
cache_entry = cache_plugin.get(document_path, DEFAULT_CACHE_SCOPE)
data_list = cache_entry.getValue().get(cache_id) data_list = cache_entry.getValue().get(cache_id)
if data_list: if data_list:
md5sum, mime, data = data_list md5sum, mime, data = data_list
......
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