Commit 5f25a821 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* add '/view' at the end for non Web Page documents in WebSection_getPermanentURL.

* always use getPermanentURL in WebSection_viewContentListAsRSS.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28788 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 615428c4
...@@ -99,7 +99,8 @@ if not reference:\n ...@@ -99,7 +99,8 @@ if not reference:\n
# Return absolute URL if this is not an appropriate portal_type\n # Return absolute URL if this is not an appropriate portal_type\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
valid_portal_type_list = portal.getPortalDocumentTypeList()\n valid_portal_type_list = portal.getPortalDocumentTypeList()\n
if document.getPortalType() not in valid_portal_type_list:\n portal_type = document.getPortalType()\n
if portal_type not in valid_portal_type_list:\n
return document.absolute_url()\n return document.absolute_url()\n
\n \n
# Return absolute URL if this is not a \'live\' document\n # Return absolute URL if this is not a \'live\' document\n
...@@ -109,7 +110,12 @@ if document.getValidationState() not in validation_state:\n ...@@ -109,7 +110,12 @@ if document.getValidationState() not in validation_state:\n
return document.absolute_url()\n return document.absolute_url()\n
\n \n
# Return the URL\n # Return the URL\n
return "%s/%s" % (context.absolute_url(), reference)\n # XXX we need to add \'/view\' in web view\'s permanent URL for non-Web Page documents.\n
# If we change the behaviour of index_html() to same as view(), we can remove \'/view\'. \n
if portal_type == \'Web Page\':\n
return "%s/%s" % (context.absolute_url(), reference)\n
else:\n
return "%s/%s/view" % (context.absolute_url(), reference)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -152,6 +158,7 @@ return "%s/%s" % (context.absolute_url(), reference)\n ...@@ -152,6 +158,7 @@ return "%s/%s" % (context.absolute_url(), reference)\n
<string>context</string> <string>context</string>
<string>portal</string> <string>portal</string>
<string>valid_portal_type_list</string> <string>valid_portal_type_list</string>
<string>portal_type</string>
<string>validation_state</string> <string>validation_state</string>
</tuple> </tuple>
</value> </value>
......
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python:(cell.getPortalType() == \'Web Page\' and cell.getPermanentURL(cell) or cell.absolute_url() + \'/view\')</string> </value> <value> <string>python:cell.getPermanentURL(cell)</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
847 848
\ 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