Commit cc10bdc6 authored by Yusei Tahara's avatar Yusei Tahara

2008-07-01

* Fix WebSection_viewInlinePageRenderer. Prevent to get a non document object. Thank you for Thomas Nouret.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22161 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8ea03b67
...@@ -66,22 +66,23 @@ ...@@ -66,22 +66,23 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""\n
Cache and return a given Web Page as stripped HTML\n Cache and return a given Web Page as stripped HTML\n
Use reference and language as cache keys\n Use reference and language as cache keys\n
\n \n
TODO: remove same script in KM (XXX)\n TODO: remove same script in KM (XXX)\n
"""\n """\n
\n \n
def getInlinePage(reference, language):\n def getInlinePage(reference, language):\n
page = context.restrictedTraverse(reference)\n if reference:\n
if page is not None:\n page = context.restrictedTraverse(reference)\n
return page.asStrippedHTML()\n if page is not None:\n
return None\n return page.asStrippedHTML()\n
return None\n
\n \n
from Products.ERP5Type.Cache import CachingMethod\n from Products.ERP5Type.Cache import CachingMethod\n
web_site_path = context.getWebSectionValue().getPhysicalPath()\n web_site_path = context.getWebSectionValue().getPhysicalPath()\n
getInlinePage = CachingMethod(getInlinePage, \n getInlinePage = CachingMethod(getInlinePage, \n
id=(\'WebSection_getInlinePageRenderer\', web_site_path))\n id=(\'WebSection_getInlinePageRenderer\', web_site_path))\n
language = context.Localizer.get_selected_language()\n language = context.Localizer.get_selected_language()\n
return getInlinePage(reference, language)\n return getInlinePage(reference, language)\n
</string> </value> </string> </value>
......
2008-07-01
* Fix WebSection_viewInlinePageRenderer. Prevent to get a non document object. Thank you for Thomas Nouret.
2008-06-28 yo 2008-06-28 yo
* Use restrictedTraverse instead of getDocumentValue in WebSection_viewInlinePageRenderer, because we need an appropriate acquisition wrapper here. * Use restrictedTraverse instead of getDocumentValue in WebSection_viewInlinePageRenderer, because we need an appropriate acquisition wrapper here.
......
674 675
\ No newline at end of file \ No newline at end of file
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