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

we use web_site_module/site_id/section_id/page_reference as the url of the default document.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26984 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 96eada12
......@@ -188,13 +188,13 @@ class WebSection(Domain, PermanentURLMixIn):
if getDefaultDocumentValue() is not None:
# force user to login as specified in Web Section
raise Unauthorized
if document is not None:
if document is not None and document.getReference() is not None:
# we use web_site_module/site_id/section_id/page_reference
# as the url of the default document.
self.REQUEST.set('current_web_document', document)
self.REQUEST.set('is_web_section_default_document', 1)
document = aq_base(document.asContext(
id=self.getId(), # A quick hack to force URL to point to self
# XXX - A better solution here consists of using PermanentURL
# to find out under which id the document should be published
id=document.getReference(),
original_container=document.getParentValue(),
original_id=document.getId(),
editable_absolute_url=document.absolute_url()))
......
......@@ -355,7 +355,7 @@ class TestERP5Web(ERP5TypeTestCase, ZopeTestCase.Functional):
from Products.ERP5.Document.Document import Document
base_list = re.findall(Document.base_parser, str(html_page))
base_url = base_list[0]
self.assertEqual(base_url, "%s/%s/" % (websection.absolute_url(), websection.getId()))
self.assertEqual(base_url, "%s/%s/" % (websection.absolute_url(), web_page_en.getReference()))
def test_06b_DefaultDocumentForWebSite(self, quiet=quiet, run=run_all_test):
"""
......@@ -398,7 +398,7 @@ class TestERP5Web(ERP5TypeTestCase, ZopeTestCase.Functional):
from Products.ERP5.Document.Document import Document
base_list = re.findall(Document.base_parser, str(html_page))
base_url = base_list[0]
self.assertEqual(base_url, "%s/%s/" % (website.absolute_url(), website.getId()))
self.assertEqual(base_url, "%s/%s/" % (website.absolute_url(), web_page_en.getReference()))
def test_07_WebSection_getDocumentValueList(self, quiet=quiet, run=run_all_test):
""" Check getting getDocumentValueList from Web Section.
......
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